Skip to content

Commit

Permalink
Merge pull request #207 from crazy-max/tempdir-runner-temp
Browse files Browse the repository at this point in the history
Use RUNNER_TEMP as temp directory
  • Loading branch information
crazy-max authored Nov 16, 2023
2 parents 5250fc6 + 602235d commit e927ebb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
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 e927ebb

Please sign in to comment.