Files
codeql-action/src/setup/repository.ts
2026-10-06 17:07:47 +01:00

20 lines
793 B
TypeScript

import { isRunningLocalAction } from "../actions-util";
import { Logger } from "../logging";
import * as util from "../util";
export const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action";
export function getCodeQLActionRepository(logger: Logger): string {
if (isRunningLocalAction()) {
// This handles the case where the Action does not come from an Action repository,
// e.g. our integration tests which use the Action code from the current checkout.
// In these cases, the GITHUB_ACTION_REPOSITORY environment variable is not set.
logger.info(
"The CodeQL Action is checked out locally. Using the default CodeQL Action repository.",
);
return CODEQL_DEFAULT_ACTION_REPOSITORY;
}
return util.getRequiredEnvParam("GITHUB_ACTION_REPOSITORY");
}