From cf99786d43ff6b9c737b65059e77db5aeb0c95ed Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 18 Nov 2026 15:43:12 +0100 Subject: [PATCH 1/2] ci: check the built commit before a manual docs release --- .github/workflows/manual_release_docs.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/manual_release_docs.yaml b/.github/workflows/manual_release_docs.yaml index c88a401d..e8d5414d 100644 --- a/.github/workflows/manual_release_docs.yaml +++ b/.github/workflows/manual_release_docs.yaml @@ -37,15 +37,6 @@ jobs: sha: ${{ steps.sha.outputs.sha }} steps: - # Gate manual dispatches on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`); - # skipped when called from another workflow. - - name: Wait for checks - if: github.event_name == 'workflow_dispatch' - uses: apify/actions/wait-for-checks@v1.6.2 - with: - ref: ${{ github.sha }} - check-regexp: ^Checks - - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -56,6 +47,15 @@ jobs: id: sha run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + # Gate manual dispatches on the `Checks` workflow already succeeding on the built commit (run by `on_master.yaml`); + # skipped when called from another workflow. + - name: Wait for checks + if: github.event_name == 'workflow_dispatch' + uses: apify/actions/wait-for-checks@v1.6.2 + with: + ref: ${{ steps.sha.outputs.sha }} + check-regexp: ^Checks + - name: Set up Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: From 899dc1819abc1fd1a71f6a48e36ceee900b01ae9 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 18 Nov 2026 15:55:10 +0100 Subject: [PATCH 2/2] ci: gate only manual docs releases and require a release branch --- .github/workflows/manual_release_docs.yaml | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manual_release_docs.yaml b/.github/workflows/manual_release_docs.yaml index e8d5414d..58339b9a 100644 --- a/.github/workflows/manual_release_docs.yaml +++ b/.github/workflows/manual_release_docs.yaml @@ -18,6 +18,11 @@ on: required: false type: string default: "" + skip_checks: + description: Skip the release branch and `Checks` gate for the built commit. The calling workflows run their own gate. + required: false + type: boolean + default: true permissions: contents: read @@ -47,10 +52,26 @@ jobs: id: sha run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - # Gate manual dispatches on the `Checks` workflow already succeeding on the built commit (run by `on_master.yaml`); - # skipped when called from another workflow. + # A manual dispatch builds only a commit that is on a release branch and passed the `Checks` workflow (run by + # `on_master.yaml`). Calling workflows skip both steps through `skip_checks`. + - name: Check that the commit is on a release branch + if: ${{ !inputs.skip_checks }} + env: + GH_TOKEN: ${{ github.token }} + SHA: ${{ steps.sha.outputs.sha }} + run: | + branches=$(gh api --paginate "repos/$GITHUB_REPOSITORY/branches" --jq '.[].name' | grep -E '^(master|release-v.+)$') + for branch in $branches; do + status=$(gh api "repos/$GITHUB_REPOSITORY/compare/$branch...$SHA" --jq .status || true) + if [[ "$status" == "identical" || "$status" == "behind" ]]; then + exit 0 + fi + done + echo "::error::$SHA is not on a release branch" + exit 1 + - name: Wait for checks - if: github.event_name == 'workflow_dispatch' + if: ${{ !inputs.skip_checks }} uses: apify/actions/wait-for-checks@v1.6.2 with: ref: ${{ steps.sha.outputs.sha }}