File tree Expand file tree Collapse file tree 1 file changed +9
-24
lines changed Expand file tree Collapse file tree 1 file changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,14 @@ name: Triage PR
2
2
3
3
on :
4
4
pull_request_target :
5
+ branches :
6
+ - main
5
7
types :
6
8
- opened
9
+ - reopened
7
10
- edited
8
11
- synchronize
9
12
- ready_for_review
10
- branches :
11
- - main
12
13
13
14
permissions :
14
15
contents : read # the config file
@@ -17,31 +18,15 @@ permissions:
17
18
checks : write # to generate status
18
19
19
20
jobs :
20
- pr-lint :
21
+ pr-title :
21
22
name : Validate PR title
22
23
runs-on : ubuntu-latest
23
24
steps :
24
- - uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
25
- with :
26
- script : |
27
- const title = context.payload.pull_request.title;
28
- const regex = /^(?<type>build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|deps)(?<scope>\([\w\-\/]+\)?((?=:\s)|(?=!:\s)))?(?<breaking>!)?(?<subject>:\s.*)?/gm;
29
- const match = regex.exec(title);
30
-
31
- if (!match) {
32
- core.setFailed('Invalid PR title');
33
- }
34
- if (!match.groups.type && !match.groups.subject) {
35
- core.setFailed('Missing type and subject in PR title');
36
- }
37
- if (!match.groups.type) {
38
- core.setFailed('Missing type in PR title');
39
- }
40
- if (!match.groups.subject) {
41
- core.setFailed('Missing subject in PR title');
42
- }
43
-
44
- labeler :
25
+ - uses : amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5
26
+ env :
27
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
+
29
+ pr-labeler :
45
30
name : Auto-label PR
46
31
runs-on : ubuntu-latest
47
32
steps :
You can’t perform that action at this time.
0 commit comments