File tree Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Expand file tree Collapse file tree 2 files changed +26
-8
lines changed Original file line number Diff line number Diff line change 1
- on :
2
- [pull_request]
1
+ on : [pull_request]
3
2
4
3
name : Check
5
4
8
7
name : Run Unit Tests
9
8
runs-on : ubuntu-latest
10
9
steps :
11
- - name : Checkout
12
- uses : actions/checkout@v2
13
- - name : Run tests
14
- run : |
15
- npm ci
16
- npm test
10
+ - name : Checkout
11
+ uses : actions/checkout@v2
12
+ - name : Run tests
13
+ run : |
14
+ npm ci
15
+ npm test
16
+
17
+ conventional-commits :
18
+ name : Semantic Pull Request
19
+ runs-on : ubuntu-latest
20
+ steps :
21
+ - name : validate
22
+ uses : actions/github-script@v6
23
+ with :
24
+ script : |
25
+ // See https://gist.github.com/marcojahn/482410b728c31b221b70ea6d2c433f0c#file-conventional-commit-regex-md
26
+ const regex = /^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)/g;
27
+ const pr = context.payload.pull_request;
28
+ const title = pr.title;
29
+ if (title.match(regex) == null) {
30
+ throw `PR title "${title}"" does not match conventional commits from https://www.conventionalcommits.org/en/v1.0.0/`
31
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ queue_rules:
4
4
# Conditions to get out of the queue (= merged)
5
5
- status-success=Run Unit Tests
6
6
- status-success=Semantic Pull Request
7
+ - status-success=Analyze (javascript)
7
8
8
9
pull_request_rules :
9
10
- name : Automatically merge on CI success and review approval
@@ -14,6 +15,7 @@ pull_request_rules:
14
15
- -approved-reviews-by~=author
15
16
- status-success=Run Unit Tests
16
17
- status-success=Semantic Pull Request
18
+ - status-success=Analyze (javascript)
17
19
- label!=work-in-progress
18
20
- -title~=(WIP|wip)
19
21
- -merged
@@ -30,6 +32,7 @@ pull_request_rules:
30
32
- author=dependabot[bot]
31
33
- status-success=Run Unit Tests
32
34
- status-success=Semantic Pull Request
35
+ - status-success=Analyze (javascript)
33
36
- -title~=(WIP|wip)
34
37
- -label~=(blocked|do-not-merge)
35
38
- -merged
You can’t perform that action at this time.
0 commit comments