Require clean tracked files before shipping

This commit is contained in:
2026-07-05 20:11:38 +09:00
parent 1cdfcd57b3
commit 6afc94d5fb

View File

@@ -4,6 +4,7 @@ import { join } from 'node:path';
const qaVersion = process.env.PUBLIC_QA_VERSION ?? makeQaVersion();
assertNoTrackedChanges();
runPnpmScript('verify:local-release');
runPnpmScript('qa:early');
writeReleaseManifest(qaVersion);
@@ -17,6 +18,21 @@ function makeQaVersion() {
return `ship-${stamp}`;
}
function assertNoTrackedChanges() {
const result = spawnSync('git', ['status', '--porcelain', '--untracked-files=no'], {
cwd: process.cwd(),
encoding: 'utf8'
});
if (result.status !== 0) {
throw new Error(`Could not inspect tracked git status before shipping:\n${result.stderr.trim()}`);
}
const dirty = result.stdout.trim();
if (dirty) {
throw new Error(`Refusing to ship release with uncommitted tracked changes:\n${dirty}`);
}
}
function writeReleaseManifest(qaVersion) {
const manifest = {
app: 'heros_web',