Skip to content

Commit 35f15d1

Browse files
authored
Create auto_merge.yml
1 parent 7c41988 commit 35f15d1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/c-cpp.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Auto PR Merge
2+
on:
3+
#pull_request:
4+
workflow_dispatch:
5+
jobs:
6+
Auto_Merge:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
sparse-checkout: '.github'
15+
16+
- name: Try auto approve
17+
if: github.actor == 'NadeemYaseen' || github.actor == 'zhergarvi' || github.actor == 'abdulhameed-akram'
18+
run: |
19+
urls=$(gh pr list --json url | jq -r '.[].url')
20+
for url in $urls; do
21+
echo "Approve PR: $url"
22+
gh pr review --approve "$url"
23+
gh pr merge --auto -m "$url"
24+
done
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.APPROVE_PR }}

0 commit comments

Comments
 (0)