2021-05-21 09:01:56 +00:00
|
|
|
# https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request
|
|
|
|
|
2021-05-21 13:33:56 +00:00
|
|
|
name: "Approve Workflow Run"
|
2021-05-21 09:01:56 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_run:
|
2021-05-21 13:33:56 +00:00
|
|
|
types:
|
|
|
|
- completed
|
2021-05-21 09:01:56 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
approve:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.event.workflow_run.conclusion == "action_required" }}
|
|
|
|
steps:
|
2021-05-21 13:33:56 +00:00
|
|
|
- name: "Automatically approve a workflow run"
|
2021-05-21 09:01:56 +00:00
|
|
|
run: |
|
|
|
|
curl \
|
|
|
|
--request POST \
|
|
|
|
--header "Accept: application/vnd.github.v3+json" \
|
|
|
|
--header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
|
|
--url "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/approve"
|