Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6592567

Browse files
authored
Merge pull request #3139 from github/henrymercer/fix-log-message
Fix `tools: linked` log message
2 parents fa64a7d + b1d32cf commit 6592567

File tree

6 files changed

+69
-80
lines changed

6 files changed

+69
-80
lines changed

lib/analyze-action.js

Lines changed: 9 additions & 11 deletions
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: 9 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

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

lib/upload-lib.js

Lines changed: 9 additions & 11 deletions
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: 9 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-codeql.ts

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -298,31 +298,6 @@ export async function getCodeQLSource(
298298
};
299299
}
300300

301-
/**
302-
* Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced.
303-
*
304-
* We use the special value of 'linked' to prioritize the version in `defaults.json` over the
305-
* version specified by the feature flags on Dotcom and over any pinned cached version on
306-
* Enterprise Server.
307-
*
308-
* Previously we have been using 'latest' to force the shipped tools, but this was not clear
309-
* enough for the users, so it has been changed to `linked`. We're keeping around `latest` for
310-
* backwards compatibility.
311-
*/
312-
const forceShippedTools =
313-
toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput);
314-
if (forceShippedTools) {
315-
logger.info(
316-
`'tools: ${toolsInput}' was requested, so using CodeQL version ${defaultCliVersion.cliVersion}, the version shipped with the Action.`,
317-
);
318-
319-
if (toolsInput === "latest") {
320-
logger.warning(
321-
"`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.",
322-
);
323-
}
324-
}
325-
326301
/** CLI version number, for example 2.12.6. */
327302
let cliVersion: string | undefined;
328303
/** Tag name of the CodeQL bundle, for example `codeql-bundle-20230120`. */
@@ -344,9 +319,33 @@ export async function getCodeQLSource(
344319
toolsInput = await getNightlyToolsUrl(logger);
345320
}
346321

322+
/**
323+
* Whether the tools shipped with the Action, i.e. those in `defaults.json`, have been forced.
324+
*
325+
* We use the special value of 'linked' to prioritize the version in `defaults.json` over the
326+
* version specified by the feature flags on Dotcom and over any pinned cached version on
327+
* Enterprise Server.
328+
*
329+
* Previously we have been using 'latest' to force the shipped tools, but this was not clear
330+
* enough for the users, so it has been changed to `linked`. We're keeping around `latest` for
331+
* backwards compatibility.
332+
*/
333+
const forceShippedTools =
334+
toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput);
335+
347336
if (forceShippedTools) {
348337
cliVersion = defaults.cliVersion;
349338
tagName = defaults.bundleVersion;
339+
340+
logger.info(
341+
`'tools: ${toolsInput}' was requested, so using CodeQL version ${cliVersion}, the version shipped with the Action.`,
342+
);
343+
344+
if (toolsInput === "latest") {
345+
logger.warning(
346+
"`tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.",
347+
);
348+
}
350349
} else if (toolsInput !== undefined) {
351350
// If a tools URL was provided, then use that.
352351
tagName = tryGetTagNameFromUrl(toolsInput, logger);

0 commit comments

Comments
 (0)