Skip to content

Jin/count files

Jin/count files #1

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"}'