Skip to content

Fix warning

Fix warning #21

name: Auto Approve for Owners
on:
pull_request:
types:
- opened
- synchronize
- auto_merge_enabled
jobs:
auto-approve:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == github.repository_owner && github.event.pull_request.auto_merge != null
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Auto-approve pull request
run: |
curl -s -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", "body": "Auto-approved because this PR was opened by the repository owner and auto-merge is enabled."}'