mirror of
https://github.com/waaraawa/ByteGrid.git
synced 2026-07-22 06:41:47 +00:00
chore: enforce scorecard preflight in release flow
This commit is contained in:
parent
98e42aea3d
commit
d7f0aaea24
2 changed files with 13 additions and 0 deletions
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
|
|
@ -30,6 +30,9 @@ jobs:
|
|||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Run Scorecard preflight
|
||||
run: npm run check:scorecard
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { execFileSync } from 'node:child_process';
|
||||
|
||||
const ROOT = process.cwd();
|
||||
const IGNORED_DIRS = new Set(['coverage', 'dist', 'node_modules']);
|
||||
|
|
@ -57,6 +58,15 @@ addCheck('Committed npm lockfile exists', () => {
|
|||
if (!fs.existsSync(lockfile)) {
|
||||
throw new Error('package-lock.json is required for reproducible dependency resolution');
|
||||
}
|
||||
|
||||
try {
|
||||
execFileSync('git', ['ls-files', '--error-unmatch', 'package-lock.json'], {
|
||||
cwd: ROOT,
|
||||
stdio: 'ignore',
|
||||
});
|
||||
} catch {
|
||||
throw new Error('package-lock.json must be tracked by Git');
|
||||
}
|
||||
});
|
||||
|
||||
addCheck('Release workflow includes artifact attestation', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue