Skip to content

Commit 92836d5

Browse files
authored
feat: action to approve workflow run (TheAlgorithms#4444)
1 parent b11e531 commit 92836d5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request
2+
3+
name: Approve Workflow Run
4+
5+
on:
6+
workflow_run:
7+
types:
8+
- completed
9+
10+
jobs:
11+
approve:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == "action_required" }}
14+
steps:
15+
- name: Automatically approve a workflow run
16+
run: |
17+
curl \
18+
--request POST \
19+
--header "Accept: application/vnd.github.v3+json" \
20+
--header "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
21+
--url "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/approve"

0 commit comments

Comments
 (0)