Skip to content

Commit e2e36b1

Browse files
committed
Add helper function for reserved tools values
1 parent bd51630 commit e2e36b1

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

lib/analyze-action.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-codeql.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ export async function getCodeQLSource(
279279
): Promise<CodeQLToolsSource> {
280280
if (
281281
toolsInput &&
282-
!CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput) &&
283-
!CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput) &&
282+
!isReservedToolsValue(toolsInput) &&
284283
!toolsInput.startsWith("http")
285284
) {
286285
logger.info(`Using CodeQL CLI from local path ${toolsInput}`);
@@ -821,3 +820,8 @@ async function getNightlyToolsUrl(logger: Logger) {
821820
);
822821
}
823822
}
823+
824+
function isReservedToolsValue(tools: string): boolean {
825+
return CODEQL_BUNDLE_VERSION_ALIAS.includes(tools) ||
826+
CODEQL_NIGHTLY_TOOLS_INPUTS.includes(tools);
827+
}

0 commit comments

Comments
 (0)