File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-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+ - labeled
7+ - synchronize
8+
9+ jobs :
10+ approve :
11+ name : Approve ok-to-test
12+ if : contains(github.event.pull_request.labels.*.name, 'ok-to-test')
13+ runs-on : ubuntu-latest
14+ permissions :
15+ actions : write
16+ steps :
17+ - name : Update PR
18+ uses : actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
19+ continue-on-error : true
20+ with :
21+ github-token : ${{ secrets.GITHUB_TOKEN }}
22+ script : |
23+ const result = await github.rest.actions.listWorkflowRunsForRepo({
24+ owner: context.repo.owner,
25+ repo: context.repo.repo,
26+ event: "pull_request",
27+ status: "action_required",
28+ head_sha: context.payload.pull_request.head.sha,
29+ per_page: 100
30+ });
31+
32+ for (var run of result.data.workflow_runs) {
33+ await github.rest.actions.approveWorkflowRun({
34+ owner: context.repo.owner,
35+ repo: context.repo.repo,
36+ run_id: run.id
37+ });
38+ }
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ GitHub Presubmit Workflows:
4646 * Checks markdown modified in PR for broken links.
4747* PR dependabot (run on dependabot PRs)
4848 * Regenerates Go modules and code.
49+ * PR approve GH Workflows
50+ * Approves other GH workflows if the ` ok-to-test ` label is set.
4951
5052GitHub Weekly Workflows:
5153* Weekly check all Markdown links
You can’t perform that action at this time.
0 commit comments