Skip to content

Commit 29b78ce

Browse files
authored
Run security ESLint sarif from package.json (#5)
1 parent 541191a commit 29b78ce

File tree

3 files changed

+60
-5
lines changed

3 files changed

+60
-5
lines changed

.github/workflows/security.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ jobs:
2222
security-events: write
2323
steps:
2424
- uses: actions/checkout@v3
25-
- name: Install ESLint and SARIF formatter
26-
run: npm install eslint @microsoft/eslint-formatter-sarif@2.1.7
25+
- name: Install dependencies
26+
run: npm ci --no-fund
2727
- name: Run ESLint
28-
run: npx eslint .
29-
--format @microsoft/eslint-formatter-sarif
30-
--output-file eslint-results.sarif
28+
run: npm run security:eslint
3129
continue-on-error: true
3230
- name: Upload analysis results to GitHub
3331
uses: github/codeql-action/upload-sarif@v2

package-lock.json

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"lint": "lockfile-lint && eslint -f checklist .",
3131
"lint:fix": "prettier --write \"**/*\" & eslint -f checklist --fix .",
3232
"prepublishOnly": "npm run build",
33+
"security:eslint": "eslint -f @microsoft/eslint-formatter-sarif -o eslint-results.sarif .",
3334
"test": "nyc cross-env TS_NODE_PROJECT=./tsconfig.test.json mocha",
3435
"typecheck": "tsc -p tsconfig.json --noEmit"
3536
},
@@ -39,6 +40,7 @@
3940
"@angular/compiler": "14.1.3",
4041
"@cspell/eslint-plugin": "^6.6.1",
4142
"@istanbuljs/nyc-config-typescript": "^1.0.2",
43+
"@microsoft/eslint-formatter-sarif": "^3.0.0",
4244
"@types/eslint": "8.4.5",
4345
"@types/mocha": "9.1.1",
4446
"@types/node": "18.7.6",

0 commit comments

Comments
 (0)