mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 17:39:50 +00:00
Allow overriding path of temporary files.
This commit is contained in:
@@ -45,6 +45,11 @@ export function getRequiredEnvParam(paramName: string): string {
|
||||
return value;
|
||||
}
|
||||
|
||||
export function getTemporaryDirectory(): string {
|
||||
const value = process.env["CODEQL_ACTION_TEMP"];
|
||||
return value !== undefined ? value : getRequiredEnvParam("RUNNER_TEMP");
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures all required environment variables are set in the context of a local run.
|
||||
*/
|
||||
|
||||
@@ -64,10 +64,7 @@ async function run() {
|
||||
return;
|
||||
}
|
||||
const logger = getActionsLogger();
|
||||
config = await getConfig(
|
||||
actionsUtil.getRequiredEnvParam("RUNNER_TEMP"),
|
||||
logger
|
||||
);
|
||||
config = await getConfig(actionsUtil.getTemporaryDirectory(), logger);
|
||||
if (config === undefined) {
|
||||
throw new Error(
|
||||
"Config file could not be found at expected location. Has the 'init' action been called?"
|
||||
|
||||
@@ -57,7 +57,7 @@ async function run() {
|
||||
}
|
||||
|
||||
const config = await config_utils.getConfig(
|
||||
actionsUtil.getRequiredEnvParam("RUNNER_TEMP"),
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
logger
|
||||
);
|
||||
if (config === undefined) {
|
||||
|
||||
@@ -126,7 +126,7 @@ async function run() {
|
||||
const initCodeQLResult = await initCodeQL(
|
||||
actionsUtil.getOptionalInput("tools"),
|
||||
apiDetails,
|
||||
actionsUtil.getRequiredEnvParam("RUNNER_TEMP"),
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
actionsUtil.getRequiredEnvParam("RUNNER_TOOL_CACHE"),
|
||||
"actions",
|
||||
logger
|
||||
@@ -139,7 +139,7 @@ async function run() {
|
||||
actionsUtil.getOptionalInput("queries"),
|
||||
actionsUtil.getOptionalInput("config-file"),
|
||||
parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")),
|
||||
actionsUtil.getRequiredEnvParam("RUNNER_TEMP"),
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
actionsUtil.getRequiredEnvParam("RUNNER_TOOL_CACHE"),
|
||||
codeql,
|
||||
actionsUtil.getRequiredEnvParam("GITHUB_WORKSPACE"),
|
||||
|
||||
Reference in New Issue
Block a user