Skip to content

Commit

Permalink
feat: only fail on production audit
Browse files Browse the repository at this point in the history
This still runs `audit` on all deps but will only report the errors and
not fail CI.
  • Loading branch information
lukekarrys committed Oct 27, 2022
1 parent 49a0581 commit 2c9e34c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ jobs:
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Audit
run: npm audit
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
6 changes: 4 additions & 2 deletions lib/content/_step-audit.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- name: Run Audit
run: {{ rootNpmPath }} audit
- name: Run Production Audit
run: {{ rootNpmPath }} audit --omit=dev
- name: Run Full Audit
run: {{ rootNpmPath }} audit --audit-level=none
12 changes: 8 additions & 4 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,10 @@ jobs:
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Audit
run: npm audit
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
.github/workflows/ci-release.yml
========================================
Expand Down Expand Up @@ -1424,8 +1426,10 @@ jobs:
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Audit
run: npm audit
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
.github/workflows/ci-a.yml
========================================
Expand Down
18 changes: 10 additions & 8 deletions tap-snapshots/test/check/diff-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,25 @@ The repo file audit.yml needs to be updated:
[@npmcli/template-oss ERROR] There was an erroring getting the target file
[@npmcli/template-oss ERROR] Error: {{ROOT}}/test/check/tap-testdir-diff-snapshots-update-and-remove-errors/.github/workflows/audit.yml
YAMLParseError: Implicit keys need to be on a single line at line 38, column 1:
YAMLParseError: Implicit keys need to be on a single line at line 40, column 1:
run: npm audit
run: npm audit --audit-level=none
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
^
YAMLParseError: Block scalar header includes extra characters: >>>>I at line 38, column 2:
YAMLParseError: Block scalar header includes extra characters: >>>>I at line 40, column 2:
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
^
YAMLParseError: Not a YAML token: HOPE THIS IS NOT VALID YAML<<<<<<<<<<< at line 38, column 7:
YAMLParseError: Not a YAML token: HOPE THIS IS NOT VALID YAML<<<<<<<<<<< at line 40, column 7:
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
YAMLParseError: Implicit map keys need to be followed by map values at line 38, column 1:
YAMLParseError: Implicit map keys need to be followed by map values at line 40, column 1:
run: npm audit
run: npm audit --audit-level=none
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -159,8 +159,10 @@ The repo file audit.yml needs to be updated:
run: npm -v
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Audit
run: npm audit
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
To correct it: npx template-oss-apply --force
Expand Down

0 comments on commit 2c9e34c

Please sign in to comment.