Skip to content

Commit da9119c

Browse files
ArgoZhangclaude
andauthored
chore(Robot): add auto approve action (#8108)
* ci: add auto-approve workflow using bb-auto app Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * ci: translate comment to English Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent bb912ea commit da9119c

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/auto-approve.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Auto Approve PR(bot)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- main
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
- ready_for_review
13+
14+
jobs:
15+
auto_approve:
16+
name: auto approve
17+
runs-on: ubuntu-latest
18+
# Only auto-approve PRs from trusted authors; add accounts to the list as needed
19+
if: |
20+
github.event.pull_request.draft == false &&
21+
contains(fromJSON('["ArgoZhang"]'), github.event.pull_request.user.login)
22+
23+
steps:
24+
- name: Generate bb-auto token
25+
id: app-token
26+
uses: actions/create-github-app-token@v2
27+
with:
28+
app-id: ${{ secrets.BB_AUTO_APP_ID }}
29+
private-key: ${{ secrets.BB_AUTO_PRIVATE_KEY }}
30+
31+
- name: Approve pull request
32+
env:
33+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
34+
run: |
35+
gh pr review ${{ github.event.pull_request.number }} \
36+
--repo ${{ github.repository }} \
37+
--approve \
38+
--body "Auto approved by bb-auto"

0 commit comments

Comments
 (0)