Require clean tracked files before shipping
This commit is contained in:
@@ -4,6 +4,7 @@ import { join } from 'node:path';
|
|||||||
|
|
||||||
const qaVersion = process.env.PUBLIC_QA_VERSION ?? makeQaVersion();
|
const qaVersion = process.env.PUBLIC_QA_VERSION ?? makeQaVersion();
|
||||||
|
|
||||||
|
assertNoTrackedChanges();
|
||||||
runPnpmScript('verify:local-release');
|
runPnpmScript('verify:local-release');
|
||||||
runPnpmScript('qa:early');
|
runPnpmScript('qa:early');
|
||||||
writeReleaseManifest(qaVersion);
|
writeReleaseManifest(qaVersion);
|
||||||
@@ -17,6 +18,21 @@ function makeQaVersion() {
|
|||||||
return `ship-${stamp}`;
|
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) {
|
function writeReleaseManifest(qaVersion) {
|
||||||
const manifest = {
|
const manifest = {
|
||||||
app: 'heros_web',
|
app: 'heros_web',
|
||||||
|
|||||||
Reference in New Issue
Block a user