mirror of
https://github.com/github/codeql-action.git
synced 2026-04-17 12:33:16 +00:00
Add standard tools URLs to status report
This commit is contained in:
@@ -466,6 +466,7 @@ export interface ToolsDownloadStatusReport {
|
||||
compressionMethod: tar.CompressionMethod;
|
||||
downloadDurationMs: number;
|
||||
extractionDurationMs: number;
|
||||
toolsUrl: string;
|
||||
}
|
||||
|
||||
// Exported using `export const` for testing purposes. Specifically, we want to
|
||||
@@ -553,6 +554,7 @@ export const downloadCodeQL = async function (
|
||||
compressionMethod,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
},
|
||||
toolsVersion: maybeCliVersion ?? "unknown",
|
||||
};
|
||||
@@ -585,6 +587,7 @@ export const downloadCodeQL = async function (
|
||||
compressionMethod,
|
||||
downloadDurationMs,
|
||||
extractionDurationMs,
|
||||
toolsUrl: sanitizeUrlForStatusReport(codeqlURL),
|
||||
},
|
||||
toolsVersion: maybeCliVersion ?? toolcacheVersion,
|
||||
};
|
||||
@@ -711,3 +714,11 @@ async function cleanUpGlob(glob: string, name: string, logger: Logger) {
|
||||
logger.warning(`Failed to clean up ${name}: ${e}.`);
|
||||
}
|
||||
}
|
||||
|
||||
function sanitizeUrlForStatusReport(url: string): string {
|
||||
return ["github/codeql-action", "dsp-testing/codeql-cli-nightlies"].some(
|
||||
(repo) => url.startsWith(`https://github.com/${repo}/releases/download/`),
|
||||
)
|
||||
? url
|
||||
: "sanitized-value";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user