Skip to content

Commit 759e57a

Browse files
committed
ci: Gate manual release workflows on wait-for-checks
Replace the in-release re-run of code_checks with a wait-for-checks step that verifies the relevant checks already passed on the dispatch commit (they run via on_master.yaml on every push). Saves the redundant re-run on stable release and also brings Tests into the gate; adds gates to 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 b13af58 commit 759e57a

4 files changed

Lines changed: 56 additions & 4 deletions

File tree

.github/workflows/manual_release_beta.yaml

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

1818
jobs:
19+
wait_for_checks:
20+
# Verify that `Code checks` and `Tests` already completed successfully on the dispatch commit
21+
# (they run via `on_master.yaml` on every push to master). For the auto-dispatched path from
22+
# `on_master.yaml`, these are guaranteed by `needs:` already; this also gates manual dispatches.
23+
# TODO: switch from the PR branch to a tagged release once apify/workflows#238 is merged.
24+
name: Wait for required checks
25+
runs-on: ubuntu-latest
26+
permissions:
27+
checks: read
28+
steps:
29+
- name: Wait for Code checks and Tests
30+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
31+
with:
32+
ref: ${{ github.sha }}
33+
check-regexp: '^(Code checks|Tests)'
34+
1935
release_prepare:
2036
name: Release prepare
37+
needs: [wait_for_checks]
2138
runs-on: ubuntu-latest
2239
outputs:
2340
version_number: ${{ steps.release_prepare.outputs.version_number }}

.github/workflows/manual_release_docs.yaml

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

2829
steps:
30+
# Verify `Doc checks` already passed on the dispatch commit (they run via `on_master.yaml`
31+
# on every push to master). Skipped when this workflow is invoked via `workflow_call` from
32+
# another release workflow — the parent has already gated on the relevant checks.
33+
# TODO: switch from the PR branch to a tagged release once apify/workflows#238 is merged.
34+
- name: Wait for Doc checks
35+
if: github.event_name == 'workflow_dispatch'
36+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
37+
with:
38+
ref: ${{ github.sha }}
39+
check-regexp: '^Doc checks'
40+
2941
- name: Checkout repository
3042
uses: actions/checkout@v6
3143
with:

.github/workflows/manual_release_stable.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,24 @@ 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+
# Verify that `Code checks` and `Tests` already completed successfully on the dispatch commit
34+
# (they run via `on_master.yaml` on every push to master). Avoids re-running them on release.
35+
# TODO: switch from the PR branch to a tagged release once apify/workflows#238 is merged.
36+
name: Wait for required checks
37+
runs-on: ubuntu-latest
38+
permissions:
39+
checks: read
40+
steps:
41+
- name: Wait for Code checks and Tests
42+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
43+
with:
44+
ref: ${{ github.sha }}
45+
check-regexp: '^(Code checks|Tests)'
3546

3647
release_prepare:
3748
name: Release prepare
38-
needs: [code_checks]
49+
needs: [wait_for_checks]
3950
runs-on: ubuntu-latest
4051
outputs:
4152
version_number: ${{ steps.release_prepare.outputs.version_number }}

.github/workflows/manual_version_docs.yaml

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

4041
steps:
42+
# Verify `Doc checks` already passed on the dispatch commit (they run via `on_master.yaml`
43+
# on every push to master). Skipped when invoked via `workflow_call` from the stable release —
44+
# the parent has already gated on the relevant checks.
45+
# TODO: switch from the PR branch to a tagged release once apify/workflows#238 is merged.
46+
- name: Wait for Doc checks
47+
if: github.event_name == 'workflow_dispatch'
48+
uses: apify/workflows/wait-for-checks@wait-for-checks-action
49+
with:
50+
ref: ${{ github.sha }}
51+
check-regexp: '^Doc checks'
52+
4153
- name: Checkout repository
4254
uses: actions/checkout@v6
4355
with:

0 commit comments

Comments
 (0)