Skip to content

Commit

Permalink
Use RUNNER_TEMP as temp directory
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Nov 16, 2023
1 parent 7b1a9e4 commit 602235d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/context.ts
Expand Up @@ -23,7 +23,12 @@ import * as github from '@actions/github';
import {GitHub} from './github';

export class Context {
private static readonly _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-'));
private static readonly _tmpDir = fs.mkdtempSync(path.join(Context.ensureDirExists(process.env.RUNNER_TEMP || os.tmpdir()), 'docker-actions-toolkit-'));

private static ensureDirExists(dir: string): string {
fs.mkdirSync(dir, {recursive: true});
return dir;
}

public static tmpDir(): string {
return Context._tmpDir;
Expand Down

0 comments on commit 602235d

Please sign in to comment.