feat:@coderabbitai #246
Workflow file for this run
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 and auto-merge bot pull requests | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| auto-merge: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.pull_request.draft == false && (github.actor == 'dependabot[bot]' || github.actor == 'HavenDV') && github.repository_owner == 'tryAGI' }} | |
| steps: | |
| - name: Dependabot metadata | |
| if: ${{ github.actor == 'dependabot[bot]' }} | |
| id: metadata | |
| uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Show sender | |
| run: echo ${{ github.event.pull_request.sender }} | |
| - name: Show triggering_actor | |
| run: echo ${{ github.triggering_actor }} | |
| - name: Approve a PR | |
| run: gh pr review --approve "$PR_URL" | |
| env: | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Enable auto-merge | |
| run: gh pr merge --auto --merge "$PR_URL" | |
| env: | |
| PR_URL: ${{ github.event.pull_request.html_url }} | |
| # Use a non-GITHUB_TOKEN secret so the merge can trigger downstream workflows. | |
| # For dependabot PRs there are the empty secrets.PERSONAL_TOKEN so we use fallback. | |
| GH_TOKEN: ${{ secrets.PERSONAL_TOKEN || secrets.GITHUB_TOKEN }} |