File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535 local pr_number="$1"
3636 local pr_author
3737 pr_author=$(gh pr view "$pr_number" --repo "$REPO" --json author --jq '.author.login // empty' 2>/dev/null || echo "")
38- if [ -z "$pr_author" ]; then
39- pr_author="${{ github.event.workflow_run.actor.login }}"
40- echo "::warning::Could not fetch PR author for PR #$pr_number; falling back to @$pr_author"
38+ if [ -z "$pr_author" ] || [ "$pr_author" = "null" ]; then
39+ echo "::warning::Could not fetch PR author for PR #$pr_number"
4140 fi
4241 echo "number=$pr_number" >> "$GITHUB_OUTPUT"
4342 echo "author=$pr_author" >> "$GITHUB_OUTPUT"
5049 fi
5150 HEAD_SHA="$EVENT_HEAD_SHA"
5251 echo "Payload empty. Searching for PR via Commits API..."
53- PR_NUMBER=$(gh api repos/$REPO/commits/$HEAD_SHA/pulls -q '[.[] | select(.state == "open")] [0].number' 2>/dev/null || true)
52+ PR_NUMBER=$(gh api repos/$REPO/commits/$HEAD_SHA/pulls -q '. [0].number' 2>/dev/null || true)
5453 if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
5554 echo "Found PR #$PR_NUMBER using Commits API."
5655 emit_pr "$PR_NUMBER"
You can’t perform that action at this time.
0 commit comments