File tree Expand file tree Collapse file tree 1 file changed +26
-8
lines changed
Expand file tree Collapse file tree 1 file changed +26
-8
lines changed Original file line number Diff line number Diff line change 1- name : Auto Merge PRs from Specific User
1+ name : Auto Merge PRs from github-actions[bot]
22
33on :
44 pull_request :
99 runs-on : ubuntu-latest
1010
1111 if : github.event.pull_request.user.login == 'github-actions[bot]'
12- steps :
13- - name : Checkout
14- uses : actions/checkout@v4
1512
16- - name : Wait for CI checks to complete
17- uses : ahmadnassri/action-workflow-run-wait@v1
13+ permissions :
14+ contents : read
15+ pull-requests : write
16+ statuses : read
17+
18+ steps :
19+ - name : Wait for all required status checks
20+ run : |
21+ echo "Waiting for all required status checks to pass..."
22+ for i in {1..60}; do
23+ STATUS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/status --jq '.state')
24+ echo "Current status: $STATUS"
25+ if [[ "$STATUS" == "success" ]]; then
26+ echo "All checks passed!"
27+ break
28+ elif [[ "$STATUS" == "failure" ]]; then
29+ echo "Some checks failed. Exiting."
30+ exit 1
31+ fi
32+ sleep 10
33+ done
34+ env :
35+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1836
19- - name : Merge PR via GitHub CLI
20- run : gh pr merge ${{ github.event.pull_request.number }} --merge --admin
37+ - name : Merge PR using gh CLI
38+ run : gh pr merge ${{ github.event.pull_request.html_url }} --merge --admin --delete-branch
2139 env :
2240 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments