File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
- const { isMatchWith, isRegExp, omit } = require ( 'lodash' ) ;
1
+ const { isMatchWith, isRegExp} = require ( 'lodash' ) ;
2
2
const debug = require ( 'debug' ) ( 'semantic-release:commit-analyzer' ) ;
3
3
const RELEASE_TYPES = require ( './default-release-types' ) ;
4
4
const compareReleaseTypes = require ( './compare-release-types' ) ;
@@ -15,11 +15,13 @@ module.exports = (releaseRules, commit) => {
15
15
16
16
releaseRules
17
17
. filter (
18
- rule =>
19
- ( ! rule . breaking || ( commit . notes && commit . notes . length > 0 ) ) &&
18
+ ( { breaking, release, ...rule } ) =>
19
+ // If the rule is not `breaking` or the commit doesn't have a breaking change note
20
+ ( ! breaking || ( commit . notes && commit . notes . length > 0 ) ) &&
21
+ // Otherwise match the regular rules
20
22
isMatchWith (
21
23
commit ,
22
- omit ( rule , [ 'release' , 'breaking' ] ) ,
24
+ rule ,
23
25
( obj , src ) =>
24
26
/ ^ \/ .* \/ $ / . test ( src ) || isRegExp ( src ) ? new RegExp ( / ^ \/ ( .* ) \/ $ / . exec ( src ) [ 1 ] ) . test ( obj ) : undefined
25
27
)
You can’t perform that action at this time.
0 commit comments