Throw if ENTERPRISE_RELEASES_PATH is not set

This commit is contained in:
Michael B. Gale
2026-05-19 12:36:02 +01:00
parent d98bedfdea
commit 4536424fcf
+13 -1
View File
@@ -14,7 +14,19 @@ import { API_COMPATIBILITY_FILE } from "./config";
/** The first GHES version that included Code Scanning. */
const FIRST_SUPPORTED_RELEASE: SemVer = new semver.SemVer("2.22.0");
function main() {}
/** Environment variables specific to this script. */
export enum EnvVar {
ENTERPRISE_RELEASES_PATH = "ENTERPRISE_RELEASES_PATH",
}
function main() {
const enterpriseReleasesPath = process.env[EnvVar.ENTERPRISE_RELEASES_PATH];
if (!enterpriseReleasesPath) {
throw new Error(
`${EnvVar.ENTERPRISE_RELEASES_PATH} environment variable must be set`,
);
}
}
// Only call `main` if this script was run directly.
if (require.main === module) {