File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: Label PRs
33on :
44 pull_request_target :
55 types : [opened]
6+ pull_request_review :
7+ types : [submitted]
68
79permissions :
810 contents : read
1315
1416 steps :
1517 - uses : nodejs/node-pr-labeler@d4cf1b8b9f23189c37917000e5e17e796c770a6b # v1
18+ if : github.event_name != 'pull_request_review'
1619 with :
1720 repo-token : ${{ secrets.GH_USER_TOKEN }}
1821 configuration-path : .github/label-pr-config.yml
22+ - name : Add 'Author ready' label
23+ if : github.event_name == 'pull_request_review'
24+ run : |
25+ gh pr view "$PR_URL" --json reviewDecision,statusCheckRollup,mergeable,labels --jq '
26+ if .mergeable == "MERGEABLE" and
27+ .reviewDecision == "APPROVED" and
28+ (.statusCheckRollup | all(.conclusion != "FAILURE")) and
29+ ((.labels | all(.name != "needs-ci" and .name != "author ready")) or (.labels | any(.name == "request-ci")))
30+ then
31+ halt_error
32+ end | {
33+ labels: .labels | map(.name),
34+ failedChecks: .statusCheckRollup | map(select(.conclusion == "FAILURE")),
35+ mergeable,
36+ reviewDecision,
37+ }' || gh pr edit "$PR_URL" --add-label 'author ready'
38+ env :
39+ GH_TOKEN : ${{ secrets.GH_USER_TOKEN }}
40+ PR_URL : ${{ github.event.pull_request.html_url }}
You can’t perform that action at this time.
0 commit comments