Merge branch 'main' into henrymercer/remove-legacy-tracing
This commit is contained in:
commit
8a093aa1a5
44 changed files with 198 additions and 174 deletions
20
src/util.ts
20
src/util.ts
|
|
@ -113,10 +113,10 @@ export function getExtraOptionsEnvParam(): object {
|
|||
}
|
||||
try {
|
||||
return JSON.parse(raw);
|
||||
} catch (e) {
|
||||
const message = e instanceof Error ? e.message : String(e);
|
||||
} catch (unwrappedError) {
|
||||
const error = wrapError(unwrappedError);
|
||||
throw new Error(
|
||||
`${varName} environment variable is set, but does not contain valid JSON: ${message}`
|
||||
`${varName} environment variable is set, but does not contain valid JSON: ${error.message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -438,11 +438,11 @@ export function assertNever(value: never): never {
|
|||
* knowing what version of CodeQL we're running.
|
||||
*/
|
||||
export function initializeEnvironment(version: string) {
|
||||
core.exportVariable(EnvVar.FEATURE_MULTI_LANGUAGE, "false");
|
||||
core.exportVariable(EnvVar.FEATURE_SANDWICH, "false");
|
||||
core.exportVariable(EnvVar.FEATURE_SARIF_COMBINE, "true");
|
||||
core.exportVariable(EnvVar.FEATURE_WILL_UPLOAD, "true");
|
||||
core.exportVariable(EnvVar.VERSION, version);
|
||||
core.exportVariable(String(EnvVar.FEATURE_MULTI_LANGUAGE), "false");
|
||||
core.exportVariable(String(EnvVar.FEATURE_SANDWICH), "false");
|
||||
core.exportVariable(String(EnvVar.FEATURE_SARIF_COMBINE), "true");
|
||||
core.exportVariable(String(EnvVar.FEATURE_WILL_UPLOAD), "true");
|
||||
core.exportVariable(String(EnvVar.VERSION), version);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -892,3 +892,7 @@ export function fixInvalidNotificationsInFile(
|
|||
sarif = fixInvalidNotifications(sarif, logger);
|
||||
fs.writeFileSync(outputPath, JSON.stringify(sarif));
|
||||
}
|
||||
|
||||
export function wrapError(error: unknown): Error {
|
||||
return error instanceof Error ? error : new Error(String(error));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue