Jin/count files #1
Workflow file for this run
This file contains 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 Merge PRs | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- main | |
jobs: | |
auto-merge: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Auto approve and merge if from bot/count-files branch | |
if: github.event.pull_request.head.ref == 'bot/count-files' && github.actor == 'github-actions[bot]' | |
run: | | |
echo "Approving and merging PR from bot/count-files branch" | |
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \ | |
-d '{"event":"APPROVE"}' | |
curl -X PUT -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/merge \ | |
-d '{"commit_title":"${{ github.event.pull_request.title }}","merge_method":"merge"}' |