Skip to content

Commit 9eaa671

Browse files
committed
ci: Gate manual release workflows on wait-for-checks
Replace the in-release rerun of 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). Saves the redundant rerun on the stable release; adds gates to the beta release and the docs workflows that previously had none. Pinned to the apify/workflows PR branch — switch to a tagged release once apify/workflows#238 is merged.
1 parent 208a166 commit 9eaa671

4 files changed

Lines changed: 49 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,23 @@ 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+
# TODO: pin to a tag after apify/workflows#238 is merged.
22+
name: Wait for required checks
23+
runs-on: ubuntu-latest
24+
permissions:
25+
checks: read
26+
steps:
27+
- name: Wait for checks
28+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
29+
with:
30+
ref: ${{ github.sha }}
31+
check-regexp: '^Checks'
32+
1933
release_prepare:
2034
name: Release prepare
35+
needs: [wait_for_checks]
2136
runs-on: ubuntu-latest
2237
outputs:
2338
version_number: ${{ steps.release_prepare.outputs.version_number }}

.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. TODO: pin to a tag after apify/workflows#238 is merged.
32+
- name: Wait for checks
33+
if: github.event_name == 'workflow_dispatch'
34+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
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: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,23 @@ 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+
# TODO: pin to a tag after apify/workflows#238 is merged.
35+
name: Wait for required checks
36+
runs-on: ubuntu-latest
37+
permissions:
38+
checks: read
39+
steps:
40+
- name: Wait for checks
41+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
42+
with:
43+
ref: ${{ github.sha }}
44+
check-regexp: '^Checks'
3545

3646
release_prepare:
3747
name: Release prepare
38-
needs: [code_checks]
48+
needs: [wait_for_checks]
3949
runs-on: ubuntu-latest
4050
outputs:
4151
version_number: ${{ steps.release_prepare.outputs.version_number }}

.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. TODO: pin to a tag after apify/workflows#238 is merged.
44+
- name: Wait for checks
45+
if: github.event_name == 'workflow_dispatch'
46+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
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)