Skip to content

Commit 2c9e34c

Browse files
committed
feat: only fail on production audit
This still runs `audit` on all deps but will only report the errors and not fail CI.
1 parent 49a0581 commit 2c9e34c

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

.github/workflows/audit.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ jobs:
3333
run: npm -v
3434
- name: Install Dependencies
3535
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
36-
- name: Run Audit
37-
run: npm audit
36+
- name: Run Production Audit
37+
run: npm audit --omit=dev
38+
- name: Run Full Audit
39+
run: npm audit --audit-level=none

lib/content/_step-audit.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
- name: Run Audit
2-
run: {{ rootNpmPath }} audit
1+
- name: Run Production Audit
2+
run: {{ rootNpmPath }} audit --omit=dev
3+
- name: Run Full Audit
4+
run: {{ rootNpmPath }} audit --audit-level=none

tap-snapshots/test/apply/source-snapshots.js.test.cjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ jobs:
200200
run: npm -v
201201
- name: Install Dependencies
202202
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
203-
- name: Run Audit
204-
run: npm audit
203+
- name: Run Production Audit
204+
run: npm audit --omit=dev
205+
- name: Run Full Audit
206+
run: npm audit --audit-level=none
205207
206208
.github/workflows/ci-release.yml
207209
========================================
@@ -1424,8 +1426,10 @@ jobs:
14241426
run: npm -v
14251427
- name: Install Dependencies
14261428
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
1427-
- name: Run Audit
1428-
run: npm audit
1429+
- name: Run Production Audit
1430+
run: npm audit --omit=dev
1431+
- name: Run Full Audit
1432+
run: npm audit --audit-level=none
14291433
14301434
.github/workflows/ci-a.yml
14311435
========================================

tap-snapshots/test/check/diff-snapshots.js.test.cjs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,25 @@ The repo file audit.yml needs to be updated:
9999
[@npmcli/template-oss ERROR] There was an erroring getting the target file
100100
[@npmcli/template-oss ERROR] Error: {{ROOT}}/test/check/tap-testdir-diff-snapshots-update-and-remove-errors/.github/workflows/audit.yml
101101
102-
YAMLParseError: Implicit keys need to be on a single line at line 38, column 1:
102+
YAMLParseError: Implicit keys need to be on a single line at line 40, column 1:
103103
104-
run: npm audit
104+
run: npm audit --audit-level=none
105105
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
106106
^
107107
108-
YAMLParseError: Block scalar header includes extra characters: >>>>I at line 38, column 2:
108+
YAMLParseError: Block scalar header includes extra characters: >>>>I at line 40, column 2:
109109
110110
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
111111
^
112112
113-
YAMLParseError: Not a YAML token: HOPE THIS IS NOT VALID YAML<<<<<<<<<<< at line 38, column 7:
113+
YAMLParseError: Not a YAML token: HOPE THIS IS NOT VALID YAML<<<<<<<<<<< at line 40, column 7:
114114
115115
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
116116
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117117
118-
YAMLParseError: Implicit map keys need to be followed by map values at line 38, column 1:
118+
YAMLParseError: Implicit map keys need to be followed by map values at line 40, column 1:
119119
120-
run: npm audit
120+
run: npm audit --audit-level=none
121121
>>>>I HOPE THIS IS NOT VALID YAML<<<<<<<<<<<
122122
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123123
@@ -159,8 +159,10 @@ The repo file audit.yml needs to be updated:
159159
run: npm -v
160160
- name: Install Dependencies
161161
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
162-
- name: Run Audit
163-
run: npm audit
162+
- name: Run Production Audit
163+
run: npm audit --omit=dev
164+
- name: Run Full Audit
165+
run: npm audit --audit-level=none
164166
165167
166168
To correct it: npx template-oss-apply --force

0 commit comments

Comments
 (0)