From 187972476d9fce76aa8658521d4fb6428b966d68 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 15 Jun 2026 10:27:55 +0800 Subject: [PATCH] chore(Robot): add auto approve action --- .github/workflows/auto-approve.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/auto-approve.yml diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml new file mode 100644 index 00000000..9bb6262a --- /dev/null +++ b/.github/workflows/auto-approve.yml @@ -0,0 +1,38 @@ +name: Auto Approve PR(bot) + +on: + pull_request: + branches: + - master + - main + types: + - opened + - reopened + - synchronize + - ready_for_review + +jobs: + auto_approve: + name: auto approve + runs-on: ubuntu-latest + # Only auto-approve PRs from trusted authors; add accounts to the list as needed + if: | + github.event.pull_request.draft == false && + contains(fromJSON('["ArgoZhang"]'), github.event.pull_request.user.login) + + steps: + - name: Generate bb-auto token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.BB_AUTO_APP_ID }} + private-key: ${{ secrets.BB_AUTO_PRIVATE_KEY }} + + - name: Approve pull request + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + run: | + gh pr review ${{ github.event.pull_request.number }} \ + --repo ${{ github.repository }} \ + --approve \ + --body "Auto approved by bb-auto"