From 28a040cae56d2388c9f117b110aae21d936bfa40 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 18 Nov 2026 15:43:34 +0100 Subject: [PATCH 1/2] ci: check the built commit before a manual docs release --- .github/workflows/manual_release_docs.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/manual_release_docs.yaml b/.github/workflows/manual_release_docs.yaml index 7dfea5beea..898e6144d2 100644 --- a/.github/workflows/manual_release_docs.yaml +++ b/.github/workflows/manual_release_docs.yaml @@ -35,21 +35,25 @@ jobs: runs-on: ubuntu-latest steps: - # Gate manual dispatches on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`); + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ inputs.ref }} + persist-credentials: false + + - name: Record the built commit + 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: ${{ github.sha }} + ref: ${{ steps.sha.outputs.sha }} check-regexp: ^Checks - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ inputs.ref }} - persist-credentials: false - - name: Set up Node uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: From 54781b49c552383a371570b5396afec422ac8d6e Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 18 Nov 2026 15:55:20 +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 898e6144d2..b86f579d42 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 @@ -45,10 +50,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 }}