From ffb48bc0ca6ea4ad95d0b152ba0e3e483cc58bce Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 22 Sep 2026 18:07:52 -0700 Subject: [PATCH] Scope release gate runs to exact source branch --- .github/workflows/release.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a22f9408..d3c3369a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,23 +103,14 @@ jobs: [[ "$CI_STATUS" == "$(printf 'completed\tsuccess\t%s\tpush\tCI' "$RELEASE_SHA")" ]] else CANDIDATE_RUN_ID="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release-candidate.yml \ - --commit "$RELEASE_SHA" --event push --limit 1 \ + --commit "$RELEASE_SHA" --branch "$RELEASE_BRANCH" --event push --limit 1 \ --json databaseId,status,conclusion \ --jq '.[0] | select(.status == "completed" and .conclusion == "success") | .databaseId // empty')" CI_RUN_ID="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow ci.yml \ - --commit "$RELEASE_SHA" --event push --limit 1 \ + --commit "$RELEASE_SHA" --branch "$RELEASE_BRANCH" --event push --limit 1 \ --json databaseId,status,conclusion \ --jq '.[0] | select(.status == "completed" and .conclusion == "success") | .databaseId // empty')" [[ -n "$CANDIDATE_RUN_ID" && -n "$CI_RUN_ID" ]] || exit 0 - RELEASE_RUN_IDS="$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release.yml \ - --commit "$RELEASE_SHA" --limit 20 --json databaseId,status,conclusion \ - --jq '.[] | select(.status == "completed" and .conclusion == "success") | .databaseId')" - while read -r RELEASE_RUN_ID; do - [[ -n "$RELEASE_RUN_ID" ]] || continue - PUBLISHED="$(gh run view "$RELEASE_RUN_ID" --repo "$GITHUB_REPOSITORY" --json jobs \ - --jq '.jobs[] | select(.name == "Publish tested Python artifacts" and .conclusion == "success") | .name')" - [[ -z "$PUBLISHED" ]] || exit 0 - done <<< "$RELEASE_RUN_IDS" if [[ "$RELEASE_BRANCH" == dev ]]; then DIGEST_RUN_ID="$CANDIDATE_RUN_ID" else