File tree 1 file changed +6
-7
lines changed 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,9 @@ import * as core from '@actions/core';
2
2
import { Commit , GithubService , Release } from './github' ;
3
3
import { Version } from './version' ;
4
4
5
- const EXCLAMATION_MARK_BRAKING_CHANGE_REGEX = new RegExp ( / ^ .+ ! : / ) ;
6
- const BRAKING_CHANGE_REGEX = new RegExp ( / .* B R E A K I N G C H A N G E .* / ) ;
7
- const FIX_REGEX = new RegExp ( / ^ f i x ( | \( .+ \) ) : / ) ;
8
- const FEATURE_REGEX = new RegExp ( / ^ f e a t ( | \( .+ \) ) : / ) ;
5
+ const MAJOR_REGEX = new RegExp ( '^(\\w+!: |\\w+\\(.+\\)!: )|BREAKING CHANGE' ) ;
6
+ const MINOR_REGEX = new RegExp ( '^(feat: |feat\\(.+\\): )' ) ;
7
+ const PATCH_REGEX = new RegExp ( '^(fix: |fix\\(.+\\): |chore\\(deps.*\\): )' ) ;
9
8
10
9
const github = GithubService . create ( ) ;
11
10
@@ -141,15 +140,15 @@ function increaseVersionByMessages(version: Version, messages: string[]): Versio
141
140
}
142
141
143
142
function breakingChangeTest ( message : string ) : boolean {
144
- return EXCLAMATION_MARK_BRAKING_CHANGE_REGEX . test ( message ) || BRAKING_CHANGE_REGEX . test ( message ) ;
143
+ return MAJOR_REGEX . test ( message ) ;
145
144
}
146
145
147
146
function featureTest ( message : string ) : boolean {
148
- return FEATURE_REGEX . test ( message ) ;
147
+ return PATCH_REGEX . test ( message ) ;
149
148
}
150
149
151
150
function fixTest ( message : string ) : boolean {
152
- return FIX_REGEX . test ( message ) ;
151
+ return MINOR_REGEX . test ( message ) ;
153
152
}
154
153
155
154
main ( )
You can’t perform that action at this time.
0 commit comments