Skip to content

Commit b854685

Browse files
fix(ci): prevent recursive auto-hotfix PR creation (#1968)
1 parent 1fa50be commit b854685

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/create-hotfix-pr.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@ on:
88
- 'release-candidate/*' # Trigger for any branch starting with 'release-candidate/'
99

1010
jobs:
11+
skip_auto_hotfix_pr:
12+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'auto-hotfix')
13+
runs-on: ubuntu-latest
14+
permissions: {}
15+
steps:
16+
- name: Explain auto-hotfix skip
17+
run: |
18+
echo "Skipping hotfix fan-out for auto-hotfix PR #${{ github.event.pull_request.number }}."
19+
echo "Reason: auto-generated hotfix PRs must not recursively create more hotfix PRs."
20+
1121
create_hotfix_pr:
12-
# Only run this job if the PR was actually merged
13-
if: github.event.pull_request.merged == true
22+
# Only run this job for merged non-auto-hotfix PRs to avoid recursive fan-out.
23+
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'auto-hotfix')
1424
runs-on: ubuntu-latest
1525
permissions:
1626
contents: write # To push branches and commit changes

0 commit comments

Comments
 (0)