Skip to content

Commit b28224b

Browse files
authored
fix(ci): switch execute-release to push trigger + commit-msg gate (#800)
pull_request:closed fires for every PR merged to main, and when all jobs have false if: conditions GitHub reports startup_failure instead of a clean skip. Adopted the bluefin-lts pattern: - Trigger on push:main and workflow_dispatch - check-trigger job reads the squash-merge commit message - execute only runs when message starts with 'ci: promote testing images to stable' - workflow_dispatch always runs execute (manual re-trigger path) - Proper top-level permissions (superset of all job needs) Fixes the startup_failure that has affected every run since the workflow was introduced on 2026-06-09. Assisted-by: Claude Sonnet 4.5 via pi
1 parent 1dea3e5 commit b28224b

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/execute-release.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Execute Release
22

33
on:
4-
pull_request:
5-
types:
6-
- closed
4+
push:
75
branches:
86
- main
97
workflow_dispatch:
@@ -17,11 +15,27 @@ permissions:
1715
pull-requests: write
1816

1917
jobs:
18+
check-trigger:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
is-promotion: ${{ steps.check.outputs.is-promotion }}
22+
steps:
23+
- id: check
24+
env:
25+
COMMIT_MSG: ${{ github.event.head_commit.message }}
26+
EVENT_NAME: ${{ github.event_name }}
27+
run: |
28+
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
29+
echo "is-promotion=true" >> "$GITHUB_OUTPUT"
30+
elif echo "$COMMIT_MSG" | grep -q "^ci: promote testing images to stable"; then
31+
echo "is-promotion=true" >> "$GITHUB_OUTPUT"
32+
else
33+
echo "is-promotion=false" >> "$GITHUB_OUTPUT"
34+
fi
35+
2036
execute:
21-
if: >-
22-
github.event_name == 'workflow_dispatch' ||
23-
(github.event.pull_request.merged == true &&
24-
github.event.pull_request.head.ref == 'auto/promote-testing-to-main')
37+
needs: [check-trigger]
38+
if: needs.check-trigger.outputs.is-promotion == 'true'
2539
permissions:
2640
actions: read
2741
contents: write
@@ -43,6 +57,7 @@ jobs:
4357
needs: [execute]
4458
if: always() && needs.execute.result == 'success'
4559
permissions:
60+
actions: read
4661
contents: write
4762
id-token: write
4863
packages: read

0 commit comments

Comments
 (0)