File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ before_script:
67
67
- " sh -e /etc/init.d/xvfb start"
68
68
- mkdir -p $LOGS_DIR
69
69
- npm run tslint
70
- - " node ./scripts/ci/analyze-commits .js"
70
+ - " node ./scripts/ci/forbidden-identifiers .js"
71
71
72
72
73
73
script :
Original file line number Diff line number Diff line change @@ -16,15 +16,18 @@ var blocked_statements = [
16
16
] ;
17
17
18
18
var blockedRegex = new RegExp ( '\\+.*(' + blocked_statements . join ( '|' ) + ').*$' , 'mg' ) ;
19
+ var commit_range = process . env . TRAVIS_COMMIT_RANGE || 'HEAD~1' ;
19
20
20
- var diff = child_process . execSync ( 'git diff --unified=0 HEAD~1 ./src ./e2e' ) . toString ( ) ;
21
- var isInvalid = blockedRegex . test ( diff ) ;
21
+ var diff = child_process . execSync ( `git diff --unified=0 ${ commit_range } ./src ./e2e` ) . toString ( ) ;
22
+
23
+ if ( blockedRegex . test ( diff ) ) {
22
24
23
- if ( isInvalid ) {
24
25
console . warn ( 'Warning: You are using a statement in your commit, which is not allowed.\n' +
25
26
'Blocked Statements are: ' + blocked_statements . join ( ', ' ) + '\n' +
26
27
'Please remove them, and the CI will continue.' ) ;
28
+
27
29
process . exit ( 1 ) ;
30
+
28
31
} else {
29
32
console . log ( 'Info: The commits have been analyzed and are valid!' ) ;
30
33
}
You can’t perform that action at this time.
0 commit comments