Simplify getTemporaryDirectory

This commit is contained in:
Michael B. Gale
2026-07-09 14:41:56 +01:00
parent 3f2a29899f
commit 97b52d19da
2 changed files with 4 additions and 6 deletions

3
lib/entry-points.js generated
View File

@@ -145181,8 +145181,7 @@ var getOptionalInput = function(name) {
return value.length > 0 ? value : void 0;
};
function getTemporaryDirectory(env = getEnv()) {
const value = env.getOptional("CODEQL_ACTION_TEMP" /* TEMP */);
return value !== void 0 && value !== "" ? value : env.getRequired("RUNNER_TEMP" /* RUNNER_TEMP */);
return env.getOptional("CODEQL_ACTION_TEMP" /* TEMP */) ?? env.getRequired("RUNNER_TEMP" /* RUNNER_TEMP */);
}
var PR_DIFF_RANGE_JSON_FILENAME = "pr-diff-range.json";
function getDiffRangesJsonFilePath(env = getEnv()) {

View File

@@ -68,10 +68,9 @@ export const getOptionalInput = function (name: string): string | undefined {
* value of `RUNNER_TEMP` otherwise.
*/
export function getTemporaryDirectory(env: Env = getEnv()): string {
const value = env.getOptional(EnvVar.TEMP);
return value !== undefined && value !== ""
? value
: env.getRequired(ActionsEnvVars.RUNNER_TEMP);
return (
env.getOptional(EnvVar.TEMP) ?? env.getRequired(ActionsEnvVars.RUNNER_TEMP)
);
}
const PR_DIFF_RANGE_JSON_FILENAME = "pr-diff-range.json";