Skip to content

Commit bccc4e2

Browse files
committed
update-gh-workflows
1 parent dac695d commit bccc4e2

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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-

tests/run-license.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import { glob } from "glob";
2828
import * as fs from "fs";
2929
import * as path from "path";
30-
import { logInfo, logError } from "./helper.mjs";
30+
import { logInfo, logError, runTest } from "./helper.mjs";
3131

3232
const 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);

0 commit comments

Comments
 (0)