From 6deba6bfa25f3b5f19f389f42507869384ea62d4 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Wed, 1 Jul 2026 11:28:44 -0400 Subject: [PATCH] handle commits with unlinked author (null) --- .github/workflows/cla-workflow.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cla-workflow.yml b/.github/workflows/cla-workflow.yml index 6c319d2..bbaed97 100644 --- a/.github/workflows/cla-workflow.yml +++ b/.github/workflows/cla-workflow.yml @@ -54,8 +54,11 @@ jobs: HEAD=$(gh api "repos/$BASE_REPO/pulls/$PR_NUMBER" --jq '.head.repo.full_name' 2>/dev/null || echo "") fi - # Get all unique committers on the PR - COMMITTERS=$(gh api "repos/$BASE_REPO/pulls/$PR_NUMBER/commits" --paginate --jq '.[].author.login' 2>/dev/null | sort -u | grep -v '^$') + # Get all unique committers on the PR. Use `// empty` so commits whose + # author is not linked to a GitHub account (author == null) are skipped + # rather than making jq error out. `|| true` keeps an empty result from + # tripping `set -e` via grep's no-match exit code. + COMMITTERS=$(gh api "repos/$BASE_REPO/pulls/$PR_NUMBER/commits" --paginate --jq '.[].author.login // empty' 2>/dev/null | sort -u | grep -v '^$' || true) if [[ -z "$COMMITTERS" ]]; then echo "allowlist=$BASE_ALLOWLIST" >> $GITHUB_OUTPUT