mirror of
https://github.com/github/codeql-action.git
synced 2026-01-04 21:50:17 +08:00
Fall back to gzipped bundles
This commit is contained in:
19
lib/codeql.js
generated
19
lib/codeql.js
generated
@@ -105,6 +105,23 @@ exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE = "2.15.0";
|
||||
* Versions 2.15.2+ of the CodeQL CLI support the `--sarif-include-query-help` option.
|
||||
*/
|
||||
const CODEQL_VERSION_INCLUDE_QUERY_HELP = "2.15.2";
|
||||
async function setupCodeQLBundlePreferringZstd(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) {
|
||||
let zstdError = undefined;
|
||||
if (await features.getValue(feature_flags_1.Feature.ZstdBundle)) {
|
||||
try {
|
||||
return await setupCodeql.setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, true, logger);
|
||||
}
|
||||
catch (e) {
|
||||
logger.info("Failed to set up bundle compressed using zstd, falling back to bundle compressed using gzip.");
|
||||
zstdError = e;
|
||||
}
|
||||
}
|
||||
const result = await setupCodeql.setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, false, logger);
|
||||
if (zstdError) {
|
||||
result.toolsDownloadStatusReport = Object.assign({}, result.toolsDownloadStatusReport, { zstdError: (0, util_1.wrapError)(zstdError).message });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Set up CodeQL CLI access.
|
||||
*
|
||||
@@ -120,7 +137,7 @@ const CODEQL_VERSION_INCLUDE_QUERY_HELP = "2.15.2";
|
||||
*/
|
||||
async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger, checkVersion) {
|
||||
try {
|
||||
const { codeqlFolder, toolsDownloadStatusReport, toolsSource, toolsVersion, } = await setupCodeql.setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger);
|
||||
const { codeqlFolder, toolsDownloadStatusReport, toolsSource, toolsVersion, } = await setupCodeQLBundlePreferringZstd(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger);
|
||||
let codeqlCmd = path.join(codeqlFolder, "codeql", "codeql");
|
||||
if (process.platform === "win32") {
|
||||
codeqlCmd += ".exe";
|
||||
|
||||
Reference in New Issue
Block a user