File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ concurrency:
1818jobs :
1919 find-pr :
2020 runs-on : ubuntu-latest
21- if : ${{ github.event.workflow_run.conclusion == 'failure' }}
21+ if : ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }}
2222 outputs :
2323 pr_number : ${{ steps.pr.outputs.number }}
2424 pr_author : ${{ steps.pr.outputs.author }}
3434 emit_pr() {
3535 local pr_number="$1"
3636 local pr_author
37- pr_author=$(gh pr view "$pr_number" --repo "$REPO" --json author --jq '.author.login' 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"
37+ pr_author=$(gh pr view "$pr_number" --repo "$REPO" --json author --jq '.author.login // empty' 2>/dev/null || echo "")
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"
7069 needs : find-pr
7170 if : ${{ needs.find-pr.outputs.pr_number != '' }}
7271 permissions :
73- actions : read
74- contents : read
7572 pull-requests : write
73+ actions : write
74+ contents : read
7675 uses : openwisp/openwisp-utils/.github/workflows/reusable-bot-ci-failure.yml@master
7776 with :
7877 pr_number : ${{ needs.find-pr.outputs.pr_number }}
You can’t perform that action at this time.
0 commit comments