Skip to content

Commit 97b52d1

Browse files
committed
Simplify getTemporaryDirectory
1 parent 3f2a298 commit 97b52d1

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

lib/entry-points.js

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions-util.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ export const getOptionalInput = function (name: string): string | undefined {
6868
* value of `RUNNER_TEMP` otherwise.
6969
*/
7070
export function getTemporaryDirectory(env: Env = getEnv()): string {
71-
const value = env.getOptional(EnvVar.TEMP);
72-
return value !== undefined && value !== ""
73-
? value
74-
: env.getRequired(ActionsEnvVars.RUNNER_TEMP);
71+
return (
72+
env.getOptional(EnvVar.TEMP) ?? env.getRequired(ActionsEnvVars.RUNNER_TEMP)
73+
);
7574
}
7675

7776
const PR_DIFF_RANGE_JSON_FILENAME = "pr-diff-range.json";

0 commit comments

Comments
 (0)