feat(sentinel): alert on repeated suspicious movement
This commit is contained in:
1 parent
8801e2f1b9
commit
b211e9d337
54 files changed
+3272
-2
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { publishRelease } from "./release-client.js";
|
||||
|
||||
try {
|
||||
const version = process.env.VERSION ?? "";
|
||||
const credential = process.env.RELEASE_CREDENTIAL ?? "";
|
||||
const commit = process.env.RELEASE_COMMIT ?? "";
|
||||
// Check path components and required inputs before opening an artifact or contacting Gitea.
|
||||
if (!/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(version)
|
||||
|| !credential || !/^[a-f0-9]{40}$/.test(commit)) throw new Error("Invalid input");
|
||||
const jar = await readFile(`build/libs/purpur-sentinel-${version}.jar`);
|
||||
await publishRelease({
|
||||
credential, version, commit, jar,
|
||||
notes: process.env.RELEASE_NOTES ?? "See the source history for changes.",
|
||||
}, fetch);
|
||||
console.log(`Published purpur-sentinel v${version}.`);
|
||||
} catch {
|
||||
// Never echo credentials, upstream error bodies, transport diagnostics or the environment.
|
||||
console.error("Release publication failed; inspect the release state before retrying.");
|
||||
process.exitCode = 1;
|
||||
}
|
||||
Reference in new issue
Block a user