Skip to content

Commit e927ebb

Browse files
authored
Merge pull request #207 from crazy-max/tempdir-runner-temp
Use RUNNER_TEMP as temp directory
2 parents 5250fc6 + 602235d commit e927ebb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/context.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ import * as github from '@actions/github';
2323
import {GitHub} from './github';
2424

2525
export class Context {
26-
private static readonly _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-'));
26+
private static readonly _tmpDir = fs.mkdtempSync(path.join(Context.ensureDirExists(process.env.RUNNER_TEMP || os.tmpdir()), 'docker-actions-toolkit-'));
27+
28+
private static ensureDirExists(dir: string): string {
29+
fs.mkdirSync(dir, {recursive: true});
30+
return dir;
31+
}
2732

2833
public static tmpDir(): string {
2934
return Context._tmpDir;

0 commit comments

Comments
 (0)