1
0

Use SOURCE_COMMIT w/ nixpacks
All checks were successful
Build and test project / build-and-test (push) Successful in 1m27s

This commit is contained in:
2026-03-19 22:24:41 +01:00
parent 94d0f58237
commit 0204d9263a

View File

@@ -83,7 +83,12 @@ if (existsSync(workerSrc)) {
// Get git version string // Get git version string
let versionStr = 'unknown'; let versionStr = 'unknown';
let versionLink = 'https://github.com/nicoverbruggen/kobopatch-webui'; let versionLink = 'https://github.com/nicoverbruggen/kobopatch-webui';
const nixpacksCommit = process.env.SOURCE_COMMIT;
try { try {
if (nixpacksCommit) {
versionStr = nixpacksCommit.slice(0, 7);
versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/commit/${nixpacksCommit}`;
} else {
const hash = String(execSync('git rev-parse --short HEAD', { cwd: repoDir })).trim(); const hash = String(execSync('git rev-parse --short HEAD', { cwd: repoDir })).trim();
let tag = ''; let tag = '';
@@ -100,6 +105,7 @@ try {
versionStr = dirty ? `${hash} (D)` : hash; versionStr = dirty ? `${hash} (D)` : hash;
versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/commit/${hash}`; versionLink = `https://github.com/nicoverbruggen/kobopatch-webui/commit/${hash}`;
} }
}
} catch {} } catch {}
// Generate cache-busted index.html // Generate cache-busted index.html