mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 09:40:17 +08:00
* Check `setsCodeqlRunnerEnvVar` is set in the CLI with `ToolsFeatures` * Stop setting `CODEQL_RUNNER` env var when CLI does * Add optional `features` parameter in test utils * Test that `CODEQL_RUNNER` is not set if CLI sets it
21 lines
646 B
TypeScript
21 lines
646 B
TypeScript
import { VersionInfo } from "./codeql";
|
|
|
|
export enum ToolsFeature {
|
|
IndirectTracingSupportsStaticBinaries = "indirectTracingSupportsStaticBinaries",
|
|
SetsCodeqlRunnerEnvVar = "setsCodeqlRunnerEnvVar",
|
|
}
|
|
|
|
/**
|
|
* Determines if the given feature is supported by the CLI.
|
|
*
|
|
* @param versionInfo Version information, including features, returned by the CLI.
|
|
* @param feature The feature to check for.
|
|
* @returns True if the feature is supported or false otherwise.
|
|
*/
|
|
export function isSupportedToolsFeature(
|
|
versionInfo: VersionInfo,
|
|
feature: ToolsFeature,
|
|
): boolean {
|
|
return !!versionInfo.features && versionInfo.features[feature];
|
|
}
|