Use SOURCE_COMMIT w/ nixpacks
All checks were successful
Build and test project / build-and-test (push) Successful in 1m27s
All checks were successful
Build and test project / build-and-test (push) Successful in 1m27s
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user