mirror of
https://github.com/github/codeql-action.git
synced 2026-11-05 04:29:40 +00:00
Take a single ActionState parameter in getPerLanguageBundleLanguage
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
8
lib/entry-points.js
generated
8
lib/entry-points.js
generated
@@ -175621,7 +175621,7 @@ function getOtherLanguagePacksReason(inputs) {
|
||||
function findNonBuiltInQuery(queries) {
|
||||
return queries?.find((query) => !defaultSuites.has(query.uses))?.uses;
|
||||
}
|
||||
function getPerLanguageBundleLanguage({ env, logger: logger2 }, options) {
|
||||
function getPerLanguageBundleLanguage(action, options) {
|
||||
const {
|
||||
rawLanguages,
|
||||
otherLanguagePacksReason,
|
||||
@@ -175632,7 +175632,9 @@ function getPerLanguageBundleLanguage({ env, logger: logger2 }, options) {
|
||||
isLatestNightly
|
||||
} = options;
|
||||
const explain = (reason) => {
|
||||
logger2.debug(`Not using a per-language CodeQL bundle since ${reason}.`);
|
||||
action.logger.debug(
|
||||
`Not using a per-language CodeQL bundle since ${reason}.`
|
||||
);
|
||||
return void 0;
|
||||
};
|
||||
if (otherLanguagePacksReason !== void 0) {
|
||||
@@ -175653,7 +175655,7 @@ function getPerLanguageBundleLanguage({ env, logger: logger2 }, options) {
|
||||
if (variant !== "GitHub.com" /* DOTCOM */) {
|
||||
return explain(`we are running against ${variant}`);
|
||||
}
|
||||
if (!isGitHubHostedRunner(env)) {
|
||||
if (!isGitHubHostedRunner(action.env)) {
|
||||
return explain("the job is not running on a GitHub-hosted runner");
|
||||
}
|
||||
if (!isLatestNightly) {
|
||||
|
||||
@@ -139,7 +139,7 @@ export interface PerLanguageBundleOptions {
|
||||
|
||||
/** Returns the eligible bundle language, or undefined for the combined bundle. */
|
||||
export function getPerLanguageBundleLanguage(
|
||||
{ env, logger }: ActionState<["Logger", "ReadOnlyEnv"]>,
|
||||
action: ActionState<["Logger", "ReadOnlyEnv"]>,
|
||||
options: PerLanguageBundleOptions,
|
||||
): BuiltInLanguage | undefined {
|
||||
const {
|
||||
@@ -153,7 +153,9 @@ export function getPerLanguageBundleLanguage(
|
||||
} = options;
|
||||
|
||||
const explain = (reason: string) => {
|
||||
logger.debug(`Not using a per-language CodeQL bundle since ${reason}.`);
|
||||
action.logger.debug(
|
||||
`Not using a per-language CodeQL bundle since ${reason}.`,
|
||||
);
|
||||
return undefined;
|
||||
};
|
||||
|
||||
@@ -188,7 +190,7 @@ export function getPerLanguageBundleLanguage(
|
||||
return explain(`we are running against ${variant}`);
|
||||
}
|
||||
|
||||
if (!isGitHubHostedRunner(env)) {
|
||||
if (!isGitHubHostedRunner(action.env)) {
|
||||
// Per-language installs stay out of the toolcache; self-hosted runners should retain
|
||||
// the reusable combined bundle instead.
|
||||
return explain("the job is not running on a GitHub-hosted runner");
|
||||
|
||||
Reference in New Issue
Block a user