File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-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+ jobs :
12+ approve :
13+ name : Approve ok-to-test
14+
15+ if : contains(github.event.pull_request.labels.*.name, 'ok-to-test')
16+
17+ runs-on : ubuntu-latest
18+
19+ permissions :
20+ actions : write
21+
22+ steps :
23+ - name : Update PR
24+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
25+ continue-on-error : true
26+ with :
27+ github-token : ${{ secrets.GITHUB_TOKEN }}
28+ script : |
29+ const result = await github.rest.actions.listWorkflowRunsForRepo({
30+ owner: context.repo.owner,
31+ repo: context.repo.repo,
32+ event: "pull_request",
33+ status: "action_required",
34+ head_sha: context.payload.pull_request.head.sha,
35+ per_page: 100
36+ });
37+
38+ for (var run of result.data.workflow_runs) {
39+ await github.rest.actions.approveWorkflowRun({
40+ owner: context.repo.owner,
41+ repo: context.repo.repo,
42+ run_id: run.id
43+ });
44+ }
You can’t perform that action at this time.
0 commit comments