Auto-approve after CodeRabbit review #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto-approve after CodeRabbit review | |
| on: | |
| pull_request_review: | |
| types: [submitted] | |
| jobs: | |
| auto-approve: | |
| runs-on: ubuntu-latest | |
| if: > | |
| github.event.review.user.login == 'coderabbitai[bot]' && | |
| github.event.review.state == 'approved' | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up GitHub CLI | |
| uses: cli/cli-action@v2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Approve PR | |
| run: gh pr review "$PR_URL" --approve | |
| shell: bash | |
| env: | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |