mirror of
https://github.com/github/codeql-action.git
synced 2026-04-17 12:33:16 +00:00
Gate zstd enablement on tar version
This commit is contained in:
@@ -17,8 +17,8 @@ import * as api from "./api-client";
|
||||
import * as defaults from "./defaults.json";
|
||||
import {
|
||||
CodeQLDefaultVersionInfo,
|
||||
Feature,
|
||||
FeatureEnablement,
|
||||
useZstdBundle,
|
||||
} from "./feature-flags";
|
||||
import { Logger } from "./logging";
|
||||
import * as tar from "./tar";
|
||||
@@ -439,7 +439,8 @@ export async function getCodeQLSource(
|
||||
url = await getCodeQLBundleDownloadURL(
|
||||
tagName!,
|
||||
apiDetails,
|
||||
cliVersion !== undefined && (await useZstdBundle(cliVersion, features)),
|
||||
cliVersion !== undefined &&
|
||||
(await useZstdBundle(cliVersion, features, logger)),
|
||||
logger,
|
||||
);
|
||||
}
|
||||
@@ -741,3 +742,15 @@ function sanitizeUrlForStatusReport(url: string): string {
|
||||
? url
|
||||
: "sanitized-value";
|
||||
}
|
||||
|
||||
async function useZstdBundle(
|
||||
cliVersion: string,
|
||||
features: FeatureEnablement,
|
||||
logger: Logger,
|
||||
): Promise<boolean> {
|
||||
return (
|
||||
semver.gte(cliVersion, "2.19.0") &&
|
||||
!!(await features.getValue(Feature.ZstdBundle)) &&
|
||||
(await tar.isZstdAvailable(logger)).available
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user