Skip to content

Commit 847bb1b

Browse files
committed
[chores] Minimal improvement
Added pr_author fallback in case of failed api request
1 parent 97a1ae6 commit 847bb1b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/bot-ci-failure.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ jobs:
3636
local pr_author
3737
pr_author=$(gh pr view "$pr_number" --repo "$REPO" --json author --jq '.author.login' 2>/dev/null || echo "")
3838
if [ -z "$pr_author" ]; then
39-
echo "::warning::Could not fetch PR author for PR #$pr_number"
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"
4041
fi
4142
echo "number=$pr_number" >> "$GITHUB_OUTPUT"
4243
echo "author=$pr_author" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)