april fools article #5081
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync pull request to preview | |
on: | |
workflow_dispatch: | |
pull_request_target: | |
types: [opened, synchronize, labeled] | |
jobs: | |
sync-pull-request: | |
if: contains(github.event.pull_request.labels.*.name, 'preview') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
ref: 'preview' # Not default 'main' branch | |
- name: Merge pr -> preview | |
uses: devmasx/[email protected] | |
with: | |
type: now | |
head_to_merge: ${{ github.event.pull_request.head.sha }} | |
target_branch: preview | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# NOTE: Above, we use the 'if' statement for looking for the 'preview' label | |
# and then only run the job if that label is found in the PR. I tried using | |
# the setting {label_name: 'preview'} for the `devmasx/merge-branch` action | |
# above but it seemed to ignore it and try to merge the PR branch to 'preview' | |
# anyway. |