mirror of
https://github.com/github/codeql-action.git
synced 2026-05-02 03:40:10 +00:00
Specify reason for skipping SARIF upload in logs
This commit is contained in:
+9
-3
@@ -771,10 +771,16 @@ export function isInTestMode(): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether we specifically want to skip uploading SARIF files.
|
||||
* Returns whether we specifically want to skip uploading SARIF files, and if so, why.
|
||||
*/
|
||||
export function shouldSkipSarifUpload(): boolean {
|
||||
return isInTestMode() || process.env[EnvVar.SKIP_SARIF_UPLOAD] === "true";
|
||||
export function getSarifUploadSkipReason(): string | null {
|
||||
if (isInTestMode()) {
|
||||
return `SARIF upload is disabled via ${EnvVar.TEST_MODE}`;
|
||||
}
|
||||
if (process.env[EnvVar.SKIP_SARIF_UPLOAD] === "true") {
|
||||
return `SARIF upload is disabled via ${EnvVar.SKIP_SARIF_UPLOAD}`;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user