pr-checkmate 1.23.24 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +89 -13
  2. package/cspell.json +11 -9
  3. package/dist/cli.js +37 -64
  4. package/dist/config/constants.d.ts +51 -3
  5. package/dist/config/constants.js +73 -11
  6. package/dist/config/pr-checkmate-workflow-docker.yml +79 -0
  7. package/dist/config/pr-checkmate-workflow.yml +65 -326
  8. package/dist/core/checks/dependencies/banned-imports.js +23 -24
  9. package/dist/core/checks/dependencies/circular-deps.js +1 -0
  10. package/dist/core/checks/dependencies/dependency-check.js +1 -0
  11. package/dist/core/checks/dependencies/grype-scan.js +1 -0
  12. package/dist/core/checks/dependencies/npm-audit.js +6 -1
  13. package/dist/core/checks/dependencies/vuln-scan.js +1 -0
  14. package/dist/core/checks/findings.d.ts +198 -19
  15. package/dist/core/checks/findings.js +474 -22
  16. package/dist/core/checks/git/custom-rules.js +21 -16
  17. package/dist/core/checks/git/diff-smell.d.ts +17 -0
  18. package/dist/core/checks/git/diff-smell.js +43 -24
  19. package/dist/core/checks/git/large-files.js +14 -2
  20. package/dist/core/checks/git/leftover-debug.js +23 -14
  21. package/dist/core/checks/git/lockfile-drift.js +2 -1
  22. package/dist/core/checks/git/merge-conflict.js +19 -8
  23. package/dist/core/checks/git/missing-tests.js +22 -6
  24. package/dist/core/checks/git/todo-fixme.js +10 -9
  25. package/dist/core/checks/languages/shellcheck.d.ts +1 -1
  26. package/dist/core/checks/languages/shellcheck.js +1 -1
  27. package/dist/core/checks/languages/typecheck.js +1 -0
  28. package/dist/core/checks/pr/pr-size-check.js +2 -1
  29. package/dist/core/checks/quality/config-validation.d.ts +14 -4
  30. package/dist/core/checks/quality/config-validation.js +119 -17
  31. package/dist/core/checks/quality/dead-code.js +1 -0
  32. package/dist/core/checks/quality/duplicate-check.js +1 -0
  33. package/dist/core/checks/quality/license-header.js +12 -2
  34. package/dist/core/checks/quality/markdown-lint.js +7 -2
  35. package/dist/core/checks/quality/spellcheck.d.ts +50 -0
  36. package/dist/core/checks/quality/spellcheck.js +141 -13
  37. package/dist/core/checks/quality/yaml-lint.js +22 -9
  38. package/dist/core/checks/security/diff-security.js +115 -28
  39. package/dist/core/checks/security/dockerfile-security.js +23 -20
  40. package/dist/core/checks/security/migration-safety.js +19 -17
  41. package/dist/core/checks/security/sensitive-file-guard.js +37 -5
  42. package/dist/core/checks/security/workflow-security.d.ts +10 -0
  43. package/dist/core/checks/security/workflow-security.js +48 -26
  44. package/dist/core/commands.d.ts +27 -0
  45. package/dist/core/commands.js +91 -0
  46. package/dist/core/context.d.ts +12 -3
  47. package/dist/core/context.js +118 -16
  48. package/dist/core/install/cache.d.ts +39 -0
  49. package/dist/core/install/cache.js +99 -0
  50. package/dist/core/install/doctor.d.ts +35 -0
  51. package/dist/core/install/doctor.js +145 -0
  52. package/dist/core/install/ensure.d.ts +60 -0
  53. package/dist/core/install/ensure.js +169 -0
  54. package/dist/core/install/lock.d.ts +33 -0
  55. package/dist/core/install/lock.js +99 -0
  56. package/dist/core/install/profiles.d.ts +64 -0
  57. package/dist/core/install/profiles.js +170 -0
  58. package/dist/core/reporters.d.ts +13 -2
  59. package/dist/core/reporters.js +145 -104
  60. package/dist/core/run-checks.d.ts +25 -1
  61. package/dist/core/run-checks.js +124 -14
  62. package/dist/core/targets.js +26 -4
  63. package/dist/core/types.d.ts +49 -1
  64. package/dist/init.d.ts +29 -14
  65. package/dist/init.js +284 -263
  66. package/dist/interfaces/index.d.ts +120 -0
  67. package/dist/scripts/copy-configs.js +4 -0
  68. package/dist/scripts/generate-install-manifests.d.ts +39 -0
  69. package/dist/scripts/generate-install-manifests.js +121 -0
  70. package/dist/scripts/publish-github.js +18 -4
  71. package/dist/utils/detect-language.d.ts +37 -4
  72. package/dist/utils/detect-language.js +113 -19
  73. package/dist/utils/http.d.ts +59 -0
  74. package/dist/utils/http.js +119 -0
  75. package/dist/utils/logger.d.ts +52 -6
  76. package/dist/utils/logger.js +125 -33
  77. package/dist/utils/pool.d.ts +49 -0
  78. package/dist/utils/pool.js +124 -0
  79. package/dist/utils/update-notifier.d.ts +9 -0
  80. package/dist/utils/update-notifier.js +57 -3
  81. package/eslint-default-rules.json +1 -1
  82. package/eslint.config.mjs +14 -2
  83. package/install-manifests/commitlint/package-lock.json +1028 -0
  84. package/install-manifests/commitlint/package.json +9 -0
  85. package/install-manifests/core/package-lock.json +1335 -0
  86. package/install-manifests/core/package.json +11 -0
  87. package/install-manifests/cpp/package-lock.json +29 -0
  88. package/install-manifests/cpp/package.json +8 -0
  89. package/install-manifests/duplicate/package-lock.json +113 -0
  90. package/install-manifests/duplicate/package.json +8 -0
  91. package/install-manifests/js/package-lock.json +5099 -0
  92. package/install-manifests/js/package.json +26 -0
  93. package/install-manifests/markdown/package-lock.json +1281 -0
  94. package/install-manifests/markdown/package.json +8 -0
  95. package/install-manifests/python/package-lock.json +21 -0
  96. package/install-manifests/python/package.json +8 -0
  97. package/install-manifests/spellcheck/package-lock.json +1047 -0
  98. package/install-manifests/spellcheck/package.json +8 -0
  99. package/package.json +14 -28
  100. package/pr-checkmate.schema.json +1062 -104
  101. package/src/config/cspell.json +11 -9
  102. package/src/config/eslint-default-rules.json +1 -1
  103. package/src/config/pr-checkmate-workflow-docker.yml +79 -0
  104. package/src/config/pr-checkmate-workflow.yml +65 -326
  105. package/src/config/pr-checkmate.schema.json +1062 -104
@@ -1,13 +1,6 @@
1
1
  {
2
2
  "version": "0.2",
3
- "language": "en,ru,uk,he,fr,es",
4
- "import": [
5
- "@cspell/dict-ru_ru/cspell-ext.json",
6
- "@cspell/dict-uk-ua/cspell-ext.json",
7
- "@cspell/dict-he/cspell-ext.json",
8
- "@cspell/dict-fr-fr/cspell-ext.json",
9
- "@cspell/dict-es-es/cspell-ext.json"
10
- ],
3
+ "language": "en,en-GB",
11
4
  "words": [
12
5
  "absdiff",
13
6
  "abspath",
@@ -467,6 +460,7 @@
467
460
  "eficiente",
468
461
  "eigen",
469
462
  "EIGEN",
463
+ "EINTEGRITY",
470
464
  "EKNFFL",
471
465
  "elbert",
472
466
  "elementwise",
@@ -1057,6 +1051,7 @@
1057
1051
  "oaep",
1058
1052
  "Obagi",
1059
1053
  "objdetect",
1054
+ "Octo",
1060
1055
  "octocat",
1061
1056
  "ohlc",
1062
1057
  "ohlcv",
@@ -1757,7 +1752,14 @@
1757
1752
  "/**/yarn.lock",
1758
1753
  "/**/pnpm-lock.yaml",
1759
1754
  "/**/*.min.js",
1760
- "/**/*.min.css"
1755
+ "/**/*.min.css",
1756
+ "/CHANGELOG.md",
1757
+ "/**/__tests__/**",
1758
+ "/**/__mocks__/**",
1759
+ "/**/*.test.*",
1760
+ "/**/*.spec.*",
1761
+ "/**/test/**",
1762
+ "/**/tests/**"
1761
1763
  ],
1762
1764
  "enableFiletypes": ["typescript", "javascript", "markdown", "json"],
1763
1765
  "ignoreRegExpList": ["/https?:\\/\\/[^\\s]+/g", "/\\b[0-9a-f]{7,40}\\b/gi"]
@@ -12,7 +12,7 @@
12
12
  "@typescript-eslint/no-floating-promises": ["error"],
13
13
  "space-before-function-paren": "off",
14
14
  "operator-linebreak": "off",
15
- "max-len": ["warn", { "code": 100 }],
15
+ "max-len": ["warn", { "code": 300 }],
16
16
  "semi": ["warn", "always"],
17
17
  "quotes": ["warn", "single", { "avoidEscape": true }],
18
18
  "object-curly-spacing": ["warn", "always"],
@@ -0,0 +1,79 @@
1
+ name: PR CheckMate
2
+
3
+ # The container variant, scaffolded because this repository does not carry
4
+ # pr-checkmate as a dependency.
5
+ #
6
+ # The alternative would be `npx pr-checkmate`, and with no node_modules to reuse
7
+ # that resolves to whatever is newest on the registry and downloads it again on
8
+ # every job: 547 MB and about five minutes, measured. Worse, a major release
9
+ # would land on you without a line changing here — and a major release of a gate
10
+ # can start failing builds that passed yesterday.
11
+ #
12
+ # The image is pulled once and cached by the runner, and the tag below pins the
13
+ # major so nothing moves under you.
14
+
15
+ on:
16
+ pull_request:
17
+ branches: [main, master, develop]
18
+ types: [opened, synchronize, reopened]
19
+
20
+ # Least privilege. `pull-requests: write` is what lets the run upsert its summary
21
+ # comment on the PR; drop it and the checks still run, they just report to the log.
22
+ permissions:
23
+ contents: read
24
+ pull-requests: write
25
+
26
+ # Push three times in a minute and the first two runs become answers to questions
27
+ # nobody is asking any more — they still hold a runner, and they still race to
28
+ # upsert the summary comment, so a stale verdict can land on top of a fresh one.
29
+ # Keyed per PR, so runs on different pull requests never cancel each other.
30
+ concurrency:
31
+ group: pr-checkmate-${{ github.workflow }}-${{ github.ref }}
32
+ cancel-in-progress: true
33
+
34
+ jobs:
35
+ pr-checkmate:
36
+ name: PR CheckMate
37
+ runs-on: ubuntu-latest
38
+ # A hung step otherwise runs to GitHub's six-hour default before anyone hears
39
+ # about it. Every check has its own internal timeout; this is the backstop.
40
+ timeout-minutes: 20
41
+
42
+ steps:
43
+ - name: Checkout code
44
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
45
+ with:
46
+ # Required, not optional. Without the full history the PR base commit is
47
+ # not in the clone, no diff range can be built, and every diff-based
48
+ # check skips itself. The run then says `Scan Scope: … set
49
+ # fetch-depth: 0`, which is this line.
50
+ fetch-depth: 0
51
+
52
+ # One job runs the whole registry. Which checks run is decided in
53
+ # pr-checkmate.json (`severity`), not by splitting this into jobs.
54
+ #
55
+ # `--user` is not a detail: without it every file a formatter rewrites comes
56
+ # back owned by root, and the next step in your pipeline fails on
57
+ # permissions long after this one reported success.
58
+ #
59
+ # The environment variables are passed through by name rather than by value:
60
+ # the run reads them to find the PR, and interpolating them into the command
61
+ # line would put their contents into a shell.
62
+ - name: Run PR CheckMate
63
+ env:
64
+ # Not injected automatically: without this the run cannot authenticate,
65
+ # and the summary comment silently never reaches the PR.
66
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67
+ run: |
68
+ docker run --rm \
69
+ -v "$PWD:/repo" \
70
+ --user "$(id -u):$(id -g)" \
71
+ -e GITHUB_TOKEN \
72
+ -e GITHUB_REPOSITORY \
73
+ -e GITHUB_EVENT_NAME \
74
+ -e GITHUB_EVENT_PATH \
75
+ -e GITHUB_REF \
76
+ -e GITHUB_SHA \
77
+ -e CI \
78
+ -v "$GITHUB_EVENT_PATH:$GITHUB_EVENT_PATH:ro" \
79
+ ghcr.io/mybono/pr-checkmate:__IMAGE_TAG__ all
@@ -1,353 +1,92 @@
1
- name: PR Checkmate Quality Checks
1
+ name: PR CheckMate
2
2
 
3
3
  on:
4
4
  pull_request:
5
5
  branches: [main, master, develop]
6
6
  types: [opened, synchronize, reopened]
7
7
 
8
+ # Least privilege. `pull-requests: write` is what lets the run upsert its summary
9
+ # comment on the PR; drop it and the checks still run, they just report to the log.
8
10
  permissions:
9
- contents: write
11
+ contents: read
10
12
  pull-requests: write
11
13
 
12
- jobs:
13
- pr-checkmate-all:
14
- name: PR Checkmate All Checks
15
- runs-on: ubuntu-latest
16
- steps:
17
- - name: Checkout code
18
- uses: actions/checkout@v4
19
- with:
20
- ref: ${{ github.head_ref }}
21
- fetch-depth: 0
22
-
23
- - name: Setup Node.js
24
- uses: actions/setup-node@v4
25
- with:
26
- node-version: 24
27
-
28
- - name: Install dependencies
29
- run: npm ci
30
-
31
- - name: Run PR Checkmate All Checks
32
- run: npx pr-checkmate all
33
- continue-on-error: true
34
-
35
- - name: Auto-commit formatting changes
36
- run: |
37
- git config user.name "github-actions[bot]"
38
- git config user.email "github-actions[bot]@users.noreply.github.com"
39
- git add -A
40
- if ! git diff --cached --quiet; then
41
- git commit -m "style: auto-format code with Prettier"
42
- git push origin HEAD:${{ github.head_ref }}
43
- echo "Formatting changes committed and pushed"
44
- else
45
- echo "No formatting changes needed"
46
- fi
47
- env:
48
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
-
50
- lint:
51
- name: ESLint
52
- runs-on: ubuntu-latest
53
- steps:
54
- - name: Checkout code
55
- uses: actions/checkout@v4
56
-
57
- - name: Setup Node.js
58
- uses: actions/setup-node@v4
59
- with:
60
- node-version: 24
61
-
62
- - name: Install dependencies
63
- run: npm ci
64
-
65
- - name: Run ESLint
66
- run: npx pr-checkmate lint
67
- continue-on-error: true
68
-
69
- prettier:
70
- name: Prettier
71
- runs-on: ubuntu-latest
72
- steps:
73
- - name: Checkout code
74
- uses: actions/checkout@v4
75
-
76
- - name: Setup Node.js
77
- uses: actions/setup-node@v4
78
- with:
79
- node-version: 24
80
-
81
- - name: Install dependencies
82
- run: npm ci
83
-
84
- - name: Run Prettier
85
- run: npx pr-checkmate prettier
86
- continue-on-error: true
87
-
88
- spellcheck:
89
- name: Spellcheck
90
- runs-on: ubuntu-latest
91
- steps:
92
- - name: Checkout code
93
- uses: actions/checkout@v4
94
-
95
- - name: Setup Node.js
96
- uses: actions/setup-node@v4
97
- with:
98
- node-version: 24
99
-
100
- - name: Install dependencies
101
- run: npm ci
102
-
103
- - name: Run Spellcheck
104
- run: npx pr-checkmate spellcheck
105
- continue-on-error: true
106
-
107
- security:
108
- name: Security Scan
109
- runs-on: ubuntu-latest
110
- steps:
111
- - name: Checkout code
112
- uses: actions/checkout@v4
113
- with:
114
- fetch-depth: 0
115
-
116
- - name: Setup Node.js
117
- uses: actions/setup-node@v4
118
- with:
119
- node-version: 24
120
-
121
- - name: Install dependencies
122
- run: npm ci
123
-
124
- - name: Run Security Scan
125
- run: npx pr-checkmate security
126
- continue-on-error: true
127
-
128
- dependency-check:
129
- name: Dependency Check
130
- runs-on: ubuntu-latest
131
- steps:
132
- - name: Checkout code
133
- uses: actions/checkout@v4
134
- with:
135
- fetch-depth: 0
136
-
137
- - name: Setup Node.js
138
- uses: actions/setup-node@v4
139
- with:
140
- node-version: 24
141
-
142
- - name: Install dependencies
143
- run: npm ci
144
-
145
- - name: Run Dependency Check
146
- run: npx pr-checkmate dependencies
147
- continue-on-error: true
148
-
149
- circular-deps:
150
- name: Circular Dependencies
151
- runs-on: ubuntu-latest
152
- steps:
153
- - name: Checkout code
154
- uses: actions/checkout@v4
155
-
156
- - name: Setup Node.js
157
- uses: actions/setup-node@v4
158
- with:
159
- node-version: 24
160
-
161
- - name: Install dependencies
162
- run: npm ci
163
-
164
- - name: Run Circular Dependency Check
165
- run: npx pr-checkmate circular
166
- continue-on-error: true
167
-
168
- license-check:
169
- name: License Check
170
- runs-on: ubuntu-latest
171
- steps:
172
- - name: Checkout code
173
- uses: actions/checkout@v4
174
-
175
- - name: Setup Node.js
176
- uses: actions/setup-node@v4
177
- with:
178
- node-version: 24
179
-
180
- - name: Install dependencies
181
- run: npm ci
182
-
183
- - name: Run License Check
184
- run: npx pr-checkmate license
185
- continue-on-error: true
186
-
187
- pr-size:
188
- name: PR Size
189
- runs-on: ubuntu-latest
190
- steps:
191
- - name: Checkout code
192
- uses: actions/checkout@v4
193
- with:
194
- fetch-depth: 0
195
-
196
- - name: Setup Node.js
197
- uses: actions/setup-node@v4
198
- with:
199
- node-version: 24
200
-
201
- - name: Install dependencies
202
- run: npm ci
203
-
204
- - name: Check PR Size
205
- run: npx pr-checkmate pr-size
206
- continue-on-error: true
207
-
208
- pr-title:
209
- name: PR Title
210
- runs-on: ubuntu-latest
211
- steps:
212
- - name: Checkout code
213
- uses: actions/checkout@v4
214
-
215
- - name: Setup Node.js
216
- uses: actions/setup-node@v4
217
- with:
218
- node-version: 24
219
-
220
- - name: Install dependencies
221
- run: npm ci
222
-
223
- - name: Check PR Title
224
- run: npx pr-checkmate pr-title
225
- continue-on-error: true
226
-
227
- outdated-deps:
228
- name: Outdated Dependencies
229
- runs-on: ubuntu-latest
230
- steps:
231
- - name: Checkout code
232
- uses: actions/checkout@v4
233
-
234
- - name: Setup Node.js
235
- uses: actions/setup-node@v4
236
- with:
237
- node-version: 24
238
-
239
- - name: Install dependencies
240
- run: npm ci
241
-
242
- - name: Check Outdated Dependencies
243
- run: npx pr-checkmate outdated
244
- continue-on-error: true
245
-
246
- markdown-lint:
247
- name: Markdown Lint
248
- runs-on: ubuntu-latest
249
- steps:
250
- - name: Checkout code
251
- uses: actions/checkout@v4
252
- with:
253
- fetch-depth: 0
14
+ # Push three times in a minute and the first two runs become answers to questions
15
+ # nobody is asking any more — they still hold a runner, and they still race to
16
+ # upsert the summary comment, so a stale verdict can land on top of a fresh one.
17
+ # Keyed per PR, so runs on different pull requests never cancel each other.
18
+ concurrency:
19
+ group: pr-checkmate-${{ github.workflow }}-${{ github.ref }}
20
+ cancel-in-progress: true
254
21
 
255
- - name: Setup Node.js
256
- uses: actions/setup-node@v4
257
- with:
258
- node-version: 24
259
-
260
- - name: Install dependencies
261
- run: npm ci
262
-
263
- - name: Run Markdown Lint
264
- run: npx pr-checkmate markdown
265
- continue-on-error: true
266
-
267
- typecheck:
268
- name: TypeScript Type Check
269
- runs-on: ubuntu-latest
270
- steps:
271
- - name: Checkout code
272
- uses: actions/checkout@v4
273
- with:
274
- ref: ${{ github.head_ref }}
275
- fetch-depth: 0
276
-
277
- - name: Setup Node.js
278
- uses: actions/setup-node@v4
279
- with:
280
- node-version: 24
281
-
282
- - name: Install dependencies
283
- run: npm ci
284
-
285
- - name: Run TypeScript Type Check
286
- run: npx pr-checkmate typecheck
287
- continue-on-error: true
288
-
289
- diff-smell:
290
- name: Diff Code Smell
291
- runs-on: ubuntu-latest
292
- steps:
293
- - name: Checkout code
294
- uses: actions/checkout@v4
295
- with:
296
- ref: ${{ github.head_ref }}
297
- fetch-depth: 0
298
-
299
- - name: Setup Node.js
300
- uses: actions/setup-node@v4
301
- with:
302
- node-version: 24
303
-
304
- - name: Install dependencies
305
- run: npm ci
306
-
307
- - name: Scan Diff for Code Smells
308
- run: npx pr-checkmate diff-smell
309
- continue-on-error: true
310
-
311
- pr-body:
312
- name: PR Description
22
+ jobs:
23
+ pr-checkmate:
24
+ name: PR CheckMate
313
25
  runs-on: ubuntu-latest
26
+ # A hung step otherwise runs to GitHub's six-hour default before anyone hears
27
+ # about it. Every check here has its own internal timeout; this is the backstop
28
+ # for the ones that cannot fail themselves — a wedged network fetch, a tool
29
+ # waiting on stdin. Raise it for a large monorepo.
30
+ timeout-minutes: 20
314
31
  steps:
315
32
  - name: Checkout code
316
- uses: actions/checkout@v4
33
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
317
34
  with:
318
- ref: ${{ github.head_ref }}
35
+ # Required, not optional. Without the full history the PR base commit is
36
+ # not in the clone, no diff range can be built, and every diff-based
37
+ # check — Diff Security, Workflow Security, Dockerfile Security,
38
+ # Sensitive Files and a dozen others — skips itself. The run then says
39
+ # `Scan Scope: … set fetch-depth: 0`, which is this line.
319
40
  fetch-depth: 0
320
41
 
321
42
  - name: Setup Node.js
322
- uses: actions/setup-node@v4
43
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
323
44
  with:
324
45
  node-version: 24
46
+ cache: 'npm'
325
47
 
326
48
  - name: Install dependencies
327
49
  run: npm ci
328
50
 
329
- - name: Check PR Description
330
- run: npx pr-checkmate pr-body
331
- continue-on-error: true
332
-
333
- duplicate-check:
334
- name: Duplicate Code
335
- runs-on: ubuntu-latest
336
- steps:
337
- - name: Checkout code
338
- uses: actions/checkout@v4
51
+ # PR CheckMate fetches only the tooling this repository turns out to need
52
+ # (`npx pr-checkmate doctor` prints what and why). Without this step that
53
+ # tooling is fetched again on every run: the download shrinks, the wait
54
+ # does not. The key carries the pr-checkmate version, so an upgrade fetches
55
+ # afresh instead of reusing tooling meant for the previous one.
56
+ - name: Cache PR CheckMate tooling
57
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
339
58
  with:
340
- ref: ${{ github.head_ref }}
341
- fetch-depth: 0
59
+ path: ~/.cache/pr-checkmate
60
+ key: pr-checkmate-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
61
+ restore-keys: |
62
+ pr-checkmate-${{ runner.os }}-
342
63
 
343
- - name: Setup Node.js
344
- uses: actions/setup-node@v4
64
+ # Grype keeps its own vulnerability database, and it is the single largest
65
+ # download in the whole run: 134 MB compressed, 1.9 GB unpacked, refreshed
66
+ # daily upstream. Without this step every job pays for it again. The key is
67
+ # dated rather than content-hashed, because the thing that changes is the
68
+ # upstream database, not anything in this repository — a stale entry is
69
+ # restored by the prefix and grype updates it in place.
70
+ - name: Cache Grype vulnerability database
71
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
345
72
  with:
346
- node-version: 24
73
+ path: ~/.cache/grype
74
+ key: grype-db-${{ runner.os }}-${{ github.run_id }}
75
+ restore-keys: |
76
+ grype-db-${{ runner.os }}-
347
77
 
348
- - name: Install dependencies
349
- run: npm ci
350
-
351
- - name: Check for Duplicate Code
352
- run: npx pr-checkmate duplicate
353
- continue-on-error: true
78
+ # One job runs the whole registry. Splitting it per check would repeat the
79
+ # checkout and install for every one of them, and the selection of what runs
80
+ # belongs in pr-checkmate.json (`severity`), not in copied YAML.
81
+ #
82
+ # This template is the one `init` scaffolds when pr-checkmate IS a
83
+ # dependency: `npm ci` above installs it, so npx runs that copy at the
84
+ # version your lockfile pins. A repository that does not install it gets
85
+ # the container variant instead, because bare `npx` would resolve to the
86
+ # newest release and download it on every job.
87
+ - name: Run PR CheckMate
88
+ env:
89
+ # Not injected automatically: without this the run cannot authenticate,
90
+ # and the summary comment silently never reaches the PR.
91
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92
+ run: npx pr-checkmate all