From dd16fa98f46e49080bbee74ae1e87672b2133d96 Mon Sep 17 00:00:00 2001 From: Alexis Rolland Date: Fri, 21 Aug 2026 11:57:56 -0700 Subject: [PATCH] fix: fail CLA allowlist step on API errors --- .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 bc0f779..3164535 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