Add helper function for reserved tools values

This commit is contained in:
Henry Mercer
2025-09-22 13:59:40 +02:00
parent bd516303e1
commit e2e36b17af
6 changed files with 26 additions and 7 deletions

View File

@@ -279,8 +279,7 @@ export async function getCodeQLSource(
): Promise<CodeQLToolsSource> {
if (
toolsInput &&
!CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput) &&
!CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput) &&
!isReservedToolsValue(toolsInput) &&
!toolsInput.startsWith("http")
) {
logger.info(`Using CodeQL CLI from local path ${toolsInput}`);
@@ -821,3 +820,8 @@ async function getNightlyToolsUrl(logger: Logger) {
);
}
}
function isReservedToolsValue(tools: string): boolean {
return CODEQL_BUNDLE_VERSION_ALIAS.includes(tools) ||
CODEQL_NIGHTLY_TOOLS_INPUTS.includes(tools);
}