Skip to content

Commit 390639c

Browse files
felddygithub-actions[bot]
authored andcommitted
Fix GitHub Action syntax error and filter with if statement
`create` events cannot be filtered with `branches`. `branches` be will silently ignored and match all create events. See: - https://docs.github.com/en/webhooks/webhook-events-and-payloads#create - https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#create - https://github.com/orgs/community/discussions/26286 Signed-off-by: Mark Feldhousen <[email protected]> Signed-off-by: Felddy <[email protected]> (cherry picked from commit 0046244)
1 parent 7349bf9 commit 390639c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/en/flux/use-cases/gh-actions-auto-pr.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ To create the pull request whenever automation creates a new branch, in your man
3333
name: Staging Auto-PR
3434
on:
3535
create:
36-
branches: [staging]
3736
3837
jobs:
3938
pull-request:
4039
runs-on: ubuntu-latest
40+
if: |
41+
github.event.ref_type == 'branch' &&
42+
github.event.ref == 'staging'
4143
permissions:
4244
pull-requests: write
4345
steps:

0 commit comments

Comments
 (0)