Skip to content

Commit 8f0e8b0

Browse files
committed
Tweak language parsing to improve clarity
1 parent f243294 commit 8f0e8b0

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

lib/resolve-environment.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment.js.map

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

src/resolve-environment.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ export async function runResolveBuildEnvironment(
2020
const codeql = await getCodeQL(cmd);
2121

2222
let language = languageInput;
23-
if (await util.codeQlVersionAbove(codeql, CODEQL_VERSION_LANGUAGE_ALIASING)) {
24-
// Delegate to the CodeQL CLI to handle aliasing.
25-
} else {
26-
// Handle aliasing in the Action using `parseLanguage`.
23+
// If the CodeQL CLI version in use supports language aliasing, give the CLI the raw language
24+
// input. Otherwise, parse the language input and give the CLI the parsed language.
25+
if (
26+
!(await util.codeQlVersionAbove(codeql, CODEQL_VERSION_LANGUAGE_ALIASING))
27+
) {
2728
const parsedLanguage = parseLanguage(languageInput)?.toString();
2829
if (parsedLanguage === undefined) {
2930
throw new Error(`Did not recognize the language '${languageInput}'.`);

0 commit comments

Comments
 (0)