File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : PR approve GH Workflows
2
+
3
+ on :
4
+ pull_request_target :
5
+ types :
6
+ - edited
7
+ - labeled
8
+ - reopened
9
+ - synchronize
10
+
11
+ permissions : {}
12
+
13
+ jobs :
14
+ approve :
15
+ name : Approve ok-to-test
16
+ if : contains(github.event.pull_request.labels.*.name, 'ok-to-test')
17
+ runs-on : ubuntu-latest
18
+ permissions :
19
+ actions : write
20
+ steps :
21
+ - name : Update PR
22
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
23
+ continue-on-error : true
24
+ with :
25
+ github-token : ${{ secrets.GITHUB_TOKEN }}
26
+ script : |
27
+ const result = await github.rest.actions.listWorkflowRunsForRepo({
28
+ owner: context.repo.owner,
29
+ repo: context.repo.repo,
30
+ event: "pull_request",
31
+ status: "action_required",
32
+ head_sha: context.payload.pull_request.head.sha,
33
+ per_page: 100
34
+ });
35
+
36
+ for (var run of result.data.workflow_runs) {
37
+ await github.rest.actions.approveWorkflowRun({
38
+ owner: context.repo.owner,
39
+ repo: context.repo.repo,
40
+ run_id: run.id
41
+ });
42
+ }
You can’t perform that action at this time.
0 commit comments