Skip to content

Commit 02a3f03

Browse files
vdusekclaude
andcommitted
ci: Gate manual release workflows on wait-for-checks
Replace each release workflow's inline `code_checks` with a `wait-for-checks` step that verifies the `Checks` workflow already passed on the dispatch commit (it runs via `on_master.yaml` on every push). Adds the gate to the stable, beta, docs release, and docs versioning workflows that previously had none or rebuilt the code checks. Every caller that invokes a workflow requesting `checks: read` (reusable workflows are capped at the caller's permissions) explicitly grants it: doc_release in on_master.yaml, version_docs and doc_release in manual_release_stable.yaml, and doc_release_post_publish in manual_release_beta.yaml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 60288ee commit 02a3f03

4 files changed

Lines changed: 50 additions & 4 deletions

File tree

.github/workflows/manual_release_beta.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,22 @@ permissions:
1616
contents: read
1717

1818
jobs:
19+
wait_for_checks:
20+
# Gate the release on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`).
21+
name: Wait for required checks
22+
runs-on: ubuntu-latest
23+
permissions:
24+
checks: read
25+
steps:
26+
- name: Wait for checks
27+
uses: apify/actions/wait-for-checks@v1.2.0
28+
with:
29+
ref: ${{ github.sha }}
30+
check-regexp: '^Checks'
31+
1932
release_prepare:
2033
name: Release prepare
34+
needs: [wait_for_checks]
2135
runs-on: ubuntu-latest
2236
outputs:
2337
version_number: ${{ steps.release_prepare.outputs.version_number }}
@@ -82,5 +96,6 @@ jobs:
8296
contents: write
8397
pages: write
8498
id-token: write
99+
checks: read
85100
uses: ./.github/workflows/manual_release_docs.yaml
86101
secrets: inherit

.github/workflows/manual_release_docs.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ jobs:
2323
contents: write
2424
pages: write
2525
id-token: write
26+
checks: read
2627
runs-on: ubuntu-latest
2728

2829
steps:
30+
# Gate manual dispatches on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`);
31+
# skipped when called from another workflow.
32+
- name: Wait for checks
33+
if: github.event_name == 'workflow_dispatch'
34+
uses: apify/actions/wait-for-checks@v1.2.0
35+
with:
36+
ref: ${{ github.sha }}
37+
check-regexp: '^Checks'
38+
2939
- name: Checkout repository
3040
uses: actions/checkout@v6
3141
with:

.github/workflows/manual_release_stable.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,22 @@ permissions:
2929
contents: read
3030

3131
jobs:
32-
code_checks:
33-
name: Code checks
34-
uses: ./.github/workflows/_check_code.yaml
32+
wait_for_checks:
33+
# Gate the release on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`).
34+
name: Wait for required checks
35+
runs-on: ubuntu-latest
36+
permissions:
37+
checks: read
38+
steps:
39+
- name: Wait for checks
40+
uses: apify/actions/wait-for-checks@v1.2.0
41+
with:
42+
ref: ${{ github.sha }}
43+
check-regexp: '^Checks'
3544

3645
release_prepare:
3746
name: Release prepare
38-
needs: [code_checks]
47+
needs: [wait_for_checks]
3948
runs-on: ubuntu-latest
4049
outputs:
4150
version_number: ${{ steps.release_prepare.outputs.version_number }}
@@ -118,6 +127,7 @@ jobs:
118127
needs: [release_prepare, changelog_update, pypi_publish]
119128
permissions:
120129
contents: write
130+
checks: read
121131
uses: ./.github/workflows/manual_version_docs.yaml
122132
with:
123133
# Pass the bumped version explicitly — the job's checkout uses the dispatch ref (pre-bump),
@@ -132,5 +142,6 @@ jobs:
132142
contents: write
133143
pages: write
134144
id-token: write
145+
checks: read
135146
uses: ./.github/workflows/manual_release_docs.yaml
136147
secrets: inherit

.github/workflows/manual_version_docs.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,18 @@ jobs:
3636
runs-on: ubuntu-latest
3737
permissions:
3838
contents: write
39+
checks: read
3940

4041
steps:
42+
# Gate manual dispatches on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`);
43+
# skipped when called from another workflow.
44+
- name: Wait for checks
45+
if: github.event_name == 'workflow_dispatch'
46+
uses: apify/actions/wait-for-checks@v1.2.0
47+
with:
48+
ref: ${{ github.sha }}
49+
check-regexp: '^Checks'
50+
4151
- name: Checkout repository
4252
uses: actions/checkout@v6
4353
with:

0 commit comments

Comments
 (0)