File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Auto Merge Contributor PRs
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+
7+ permissions :
8+ contents : write
9+ pull-requests : write
10+
11+ jobs :
12+ auto-merge :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+
20+ - name : Check only Contributors.md was modified
21+ id : check-files
22+ run : |
23+ CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
24+ echo "Changed files: $CHANGED"
25+ if [ "$CHANGED" = "Contributors.md" ]; then
26+ echo "valid=true" >> $GITHUB_OUTPUT
27+ else
28+ echo "valid=false" >> $GITHUB_OUTPUT
29+ echo "PR modifies files other than Contributors.md — skipping auto-merge."
30+ fi
31+
32+ - name : Auto-merge PR
33+ if : steps.check-files.outputs.valid == 'true'
34+ run : gh pr merge --squash "${{ github.event.pull_request.number }}"
35+ env :
36+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments