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:
6767 - " sh -e /etc/init.d/xvfb start"
6868 - mkdir -p $LOGS_DIR
6969 - npm run tslint
70- - " node ./scripts/ci/analyze-commits .js"
70+ - " node ./scripts/ci/forbidden-identifiers .js"
7171
7272
7373script :
Original file line number Diff line number Diff line change @@ -16,15 +16,18 @@ var blocked_statements = [
1616] ;
1717
1818var blockedRegex = new RegExp ( '\\+.*(' + blocked_statements . join ( '|' ) + ').*$' , 'mg' ) ;
19+ var commit_range = process . env . TRAVIS_COMMIT_RANGE || 'HEAD~1' ;
1920
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 ) ) {
2224
23- if ( isInvalid ) {
2425 console . warn ( 'Warning: You are using a statement in your commit, which is not allowed.\n' +
2526 'Blocked Statements are: ' + blocked_statements . join ( ', ' ) + '\n' +
2627 'Please remove them, and the CI will continue.' ) ;
28+
2729 process . exit ( 1 ) ;
30+
2831} else {
2932 console . log ( 'Info: The commits have been analyzed and are valid!' ) ;
3033}
You can’t perform that action at this time.
0 commit comments