From 89171d53993c803721482a1f8e3effbeee1c7aa1 Mon Sep 17 00:00:00 2001 From: Craig Martin Date: Wed, 18 Nov 2026 14:14:35 -0500 Subject: [PATCH] Check the QA package's branch head without a broken pipe Copies main's release-qa-package.yml (#9170) to stable/4.9: under pipefail, grep -q's early exit broke cut's pipe, so every valid commit was rejected. 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