File tree Expand file tree Collapse file tree 3 files changed +79
-40
lines changed
Expand file tree Collapse file tree 3 files changed +79
-40
lines changed Original file line number Diff line number Diff line change 1+ name : Auto Approve PR
2+
3+ permissions :
4+ pull-requests : write
5+
6+ on :
7+ workflow_run :
8+ workflows : ["Rocketmq Rust CI"]
9+ types :
10+ - completed
11+
12+ jobs :
13+ auto-approve :
14+ name : Auto Approve PR
15+ runs-on : ubuntu-latest
16+ if : >
17+ github.event.workflow_run.event == 'pull_request' &&
18+ github.event.workflow_run.conclusion == 'success'
19+ steps :
20+ - name : Get PR number
21+ id : pr
22+ uses : actions/github-script@v7
23+ with :
24+ script : |
25+ const pulls = await github.rest.pulls.list({
26+ owner: context.repo.owner,
27+ repo: context.repo.repo,
28+ state: 'open',
29+ head: `${context.repo.owner}:${context.payload.workflow_run.head_branch}`
30+ });
31+
32+ if (pulls.data.length > 0) {
33+ return pulls.data[0].number;
34+ }
35+ return null;
36+
37+ - name : Auto approve PR
38+ if : steps.pr.outputs.result != 'null'
39+ uses : hmarr/auto-approve-action@v4
40+ with :
41+ github-token : ${{ secrets.BOT_TOKEN }}
42+ pull-request-number : ${{ steps.pr.outputs.result }}
43+ review-message : " LGTM - All CI checks passed ✅"
Original file line number Diff line number Diff line change 1+ name : Auto Merge PR
2+
3+ permissions :
4+ contents : write
5+ pull-requests : write
6+
7+ on :
8+ workflow_run :
9+ workflows : ["Auto Approve PR"]
10+ types :
11+ - completed
12+
13+ jobs :
14+ auto-merge :
15+ name : Auto Merge PR
16+ runs-on : ubuntu-latest
17+ if : >
18+ github.event.workflow_run.event == 'pull_request' &&
19+ github.event.workflow_run.conclusion == 'success'
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ - name : Auto merge
25+ uses : pascalgn/automerge-action@v0.16.4
26+ env :
27+ GITHUB_TOKEN : ${{ secrets.BOT_TOKEN }}
28+ MERGE_LABELS : " auto merge"
29+ MERGE_METHOD : " squash"
30+ MERGE_COMMIT_MESSAGE : " automatic"
31+ MERGE_FORKS : " true"
32+ MERGE_RETRIES : " 50"
33+ MERGE_RETRY_SLEEP : " 10000"
34+ MERGE_REQUIRED_APPROVALS : " 1"
35+ UPDATE_METHOD : " rebase"
Original file line number Diff line number Diff line change @@ -140,43 +140,4 @@ jobs:
140140 token : ${{ secrets.CODECOV_TOKEN }}
141141 files : lcov.info
142142 fail_ci_if_error : false
143- verbose : true
144-
145- # Auto approve PR after all checks pass
146- auto-approve :
147- name : Auto Approve PR
148- runs-on : ubuntu-latest
149- needs : [ check, build-test, coverage ]
150- if : github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
151- permissions :
152- pull-requests : write
153- steps :
154- - name : Auto approve PR
155- uses : hmarr/auto-approve-action@v4
156- with :
157- github-token : ${{ secrets.BOT_TOKEN }}
158- pull-request-number : ${{ github.event.pull_request.number }}
159- review-message : " LGTM - All CI checks passed ✅"
160-
161- # Auto merge PR after approval
162- auto-merge :
163- name : Auto Merge PR
164- runs-on : ubuntu-latest
165- needs : [ auto-approve ]
166- if : github.event_name == 'pull_request' && github.ref != 'refs/heads/main' && contains(github.event.pull_request.labels.*.name, 'auto merge')
167- permissions :
168- contents : write
169- pull-requests : write
170- steps :
171- - name : Auto merge
172- uses : pascalgn/automerge-action@v0.16.4
173- env :
174- GITHUB_TOKEN : ${{ secrets.BOT_TOKEN }}
175- MERGE_LABELS : " auto merge"
176- MERGE_METHOD : " squash"
177- MERGE_COMMIT_MESSAGE : " automatic"
178- MERGE_FORKS : " true"
179- MERGE_RETRIES : " 50"
180- MERGE_RETRY_SLEEP : " 10000"
181- MERGE_REQUIRED_APPROVALS : " 1"
182- UPDATE_METHOD : " rebase"
143+ verbose : true
You can’t perform that action at this time.
0 commit comments