File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Commit Review Cleanup
2
+
3
+ on :
4
+ pull_request_review :
5
+ branches : " commit-review-**"
6
+
7
+ jobs :
8
+ cleanup :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - run : |
12
+ PR_URL="/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}"
13
+ REMAINING=$(gh api $PR_URL/requested_reviewers | jq 'length')
14
+
15
+ if $REMAINING -eq 0; then
16
+ BRANCHES=$(gh api --method PATCH $PR_URL -f state='closed' | jq '.base.ref,.head.ref')
17
+
18
+ for BRANCH in ${BRANCHES[@]}; do
19
+ git push origin --delete $BRANCH
20
+ done
21
+ fi
Original file line number Diff line number Diff line change 6
6
- main
7
7
8
8
env :
9
- REMOTE : origin
10
9
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11
10
12
11
jobs :
93
92
pull_request :
94
93
runs-on : ubuntu-latest
95
94
needs : check
95
+ env :
96
+ REMOTE : origin
96
97
steps :
97
98
- uses : actions/checkout@v3
98
99
with :
You can’t perform that action at this time.
0 commit comments