File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,37 @@ name: Labeler
22
33on :
44 pull_request_target :
5- types : [opened, edited]
5+ types : [opened, edited, closed ]
66 issues :
77 types : [opened, edited]
8+ pull_request_review :
9+ types : [submitted]
810
911jobs :
10- Label :
12+ Reminder :
13+ if : >
14+ github.event_name == 'pull_request_review' ||
15+ (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true)
16+ runs-on : ubuntu-latest
17+ permissions :
18+ pull-requests : write
19+ steps :
20+ - name : Check if PR has no labels
21+ id : check_labels
22+ uses : actions/github-script@v7
23+ with :
24+ result-encoding : string
25+ script : |
26+ const labels = context.payload.pull_request.labels;
27+ return labels.length === 0 ? 'true' : 'false';
28+
29+ - name : Post comment if unlabeled
30+ if : steps.check_labels.outputs.result == 'true'
31+ uses : marocchino/sticky-pull-request-comment@v2
32+ with :
33+ message : Please add labels to this PR
34+ Title :
35+ if : ${{ github.event_name != 'pull_request_review' && github.event.action != 'closed' }}
1136 runs-on : ubuntu-latest
1237 permissions :
1338 pull-requests : write
You can’t perform that action at this time.
0 commit comments