File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ jobs:
100100 - *setup-node
101101 - *install-node-packages
102102
103+ - name : Run License Checks
104+ run : node run tests:license
105+
103106 - name : Run Build
104107 run : |
105108 if ${{ github.event_name == 'pull_request' }}; then
@@ -108,6 +111,3 @@ jobs:
108111 npm run test:build -- --diff="${{ github.event.before }}...${{ github.event.after }}"
109112 fi
110113
111- - name : Run License Checks
112- run : node run tests:license
113-
Original file line number Diff line number Diff line change 2727import { glob } from "glob" ;
2828import * as fs from "fs" ;
2929import * as path from "path" ;
30- import { logInfo , logError } from "./helper.mjs" ;
30+ import { logInfo , logError , runTest } from "./helper.mjs" ;
3131
3232const IGNORE_PATTERNS = [
3333 "**/node_modules/**" ,
@@ -87,12 +87,11 @@ async function checkLicenses() {
8787 if ( offendingFiles . length ) {
8888 logError ( `The following ${ offendingFiles . length } file[s] have missing license headers:` ) ;
8989 for ( const file of offendingFiles ) {
90- logError ( ` ${ file } ` ) ;
90+ logError ( ` - ${ file } ` ) ;
9191 }
92- process . exit ( 1 ) ;
93- } else {
94- logInfo ( " " ) ;
92+ throw new Error ( "Missing license headers" ) ;
9593 }
9694}
9795
98- checkLicenses ( ) ;
96+ const success = await runTest ( "Check Licenses" , checkLicenses ) ;
97+ process . exit ( success ? 0 : 1 ) ;
You can’t perform that action at this time.
0 commit comments