Take a single ActionState parameter in getPerLanguageBundleLanguage

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Henry Mercer
2026-10-22 12:04:37 +01:00
parent 626d8b9364
commit 0171a2b52f
2 changed files with 10 additions and 6 deletions

View File

@@ -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");