Skip to content

Commit

Permalink
Update pr_auto_merge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
NadeemYaseen authored Oct 14, 2024
1 parent 1f2c8b0 commit c67f25e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/pr_auto_merge.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Auto PR Merge
on:
pull_request:
#pull_request:
workflow_dispatch:
jobs:
build:
Expand All @@ -12,13 +12,10 @@ jobs:
- uses: actions/checkout@v4
- name: Try auto merge
run: |
if [ "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]; then
assigned_user=$(gh pr view ${{ github.event.pull_request.head.ref }} --json reviewRequests --jq '.reviewRequests[0].login')
fi
echo "Assigned user: $assigned_user"
if [[ $assigned_user == "NadeemYaseen" ]]
then
gh pr merge ${{ github.event.pull_request.head.ref }} --auto -m -d -t "Auto merge by $assigned_user"
fi
urls=$(gh pr list --json url | jq -r '.[].url')
for url in $urls; do
echo "Merging PR: $url"
gh pr merge --auto -m "$url"
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c67f25e

Please sign in to comment.