Skip to content

Commit

Permalink
Fix auto-approve from workflow run (#4113)
Browse files Browse the repository at this point in the history
Turns out that it does not know how to infer the pull request number now that it uses the workflow_run trigger.

I added a comment about the format
  • Loading branch information
jcscottiii authored Apr 27, 2023
1 parent 11f7ccf commit f5678d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ jobs:
github.event.workflow_run.conclusion == 'success'
permissions:
pull-requests: write
strategy:
matrix:
# workflow_run contains list of pull requests
# https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads?actionType=completed#workflow_run
# Extract the list of successful pull requests and run approvals on them.
pull_request: ${{ fromJson(toJson(github.event.workflow_run.pull_requests.*.number)) }}
steps:
- uses: hmarr/auto-approve-action@v3
with:
pull-request-number: ${{ github.event.workflow_run.event.pull_request.number }}
pull-request-number: ${{ matrix.pull_request }}

0 comments on commit f5678d0

Please sign in to comment.