Auto PR Merge #194
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 PR Merge | |
on: | |
#pull_request: | |
workflow_dispatch: | |
jobs: | |
Auto_Merge: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run step if actor is user_a, user_b, or user_c | |
if: github.actor == 'NadeemYaseen' || github.actor == 'user_b' || github.actor == 'user_c' | |
run: echo "Hello, the workflow was triggered by ${{ github.actor }}! | |
- name: Try auto approve | |
run: | | |
urls=$(gh pr list --json url | jq -r '.[].url') | |
for url in $urls; do | |
echo "Approve PR: $url" | |
gh pr review --approve "$url" | |
gh pr merge --auto -m "$url" | |
done | |
env: | |
GITHUB_TOKEN: ${{ secrets.APPROVE_PR }} |