From 28864ca8fed67cc05a957710f88ce23aff75fd2f Mon Sep 17 00:00:00 2001 From: Alexis Rolland Date: Fri, 21 Aug 2026 14:34:49 -0700 Subject: [PATCH] fix: fail CLA allowlist step on API errors (#15792) --- .github/workflows/cla.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index bc0f779cf21..31645356c4d 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -35,9 +35,12 @@ jobs: # For each commit emit the GitHub login when the author/committer email resolves to a GitHub account # otherwise fall back to the raw git name. run: | - others=$(gh api "repos/${{ github.repository }}/pulls/${PR_NUMBER}/commits" --paginate \ - --jq '.[] | (.author.login // .commit.author.name // empty), (.committer.login // .commit.committer.name // empty)' \ - | sort -u | grep -vix "${PR_AUTHOR}" | paste -sd, -) + if ! commit_authors=$(gh api "repos/${{ github.repository }}/pulls/${PR_NUMBER}/commits" --paginate \ + --jq '.[] | (.author.login // .commit.author.name // empty), (.committer.login // .commit.committer.name // empty)'); then + echo "Failed to fetch pull request commits" >&2 + exit 1 + fi + others=$(printf '%s\n' "$commit_authors" | sort -u | grep -vix "${PR_AUTHOR}" | paste -sd, -) if [ -n "$others" ]; then echo "allowlist=${BASE_ALLOWLIST},${others}" >> "$GITHUB_OUTPUT" else