From ace89d924a380bde83bafd2860788088b0d9d3ec Mon Sep 17 00:00:00 2001 From: Craig Martin Date: Wed, 18 Nov 2026 13:31:59 -0500 Subject: [PATCH] Fix the branch-head check in the Release QA package workflow Under pipefail, grep -q exits at its first match, the upstream cut gets a broken pipe, and the pipeline fails, so every valid SHA was rejected. The check now reads the branch heads first. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-qa-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-qa-package.yml b/.github/workflows/release-qa-package.yml index fc74715d9f8..f913413f5fa 100644 --- a/.github/workflows/release-qa-package.yml +++ b/.github/workflows/release-qa-package.yml @@ -37,7 +37,9 @@ jobs: fi # Only the head of one of this repository's branches, such as a Version Packages pull # request's branch, so the job never builds a fork's code with this repository's cache. - if ! git ls-remote --heads "https://github.com/$GITHUB_REPOSITORY" | cut -f 1 | grep -qx "$SHA"; then + # Read the list first: under pipefail, grep -q exiting at its first match breaks the pipe. + HEADS=$(git ls-remote --heads "https://github.com/$GITHUB_REPOSITORY" | cut -f 1) + if ! grep -qx "$SHA" <<< "$HEADS"; then echo "::error::$SHA isn't the head of a branch in $GITHUB_REPOSITORY." exit 1 fi