Skip to content

Commit

Permalink
fix: use new tmp dir options in upgraded library (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
clareliguori authored May 12, 2020
1 parent 8a694fb commit a685a32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function run() {

// Write out a new task definition file
var updatedTaskDefFile = tmp.fileSync({
dir: process.env.RUNNER_TEMP,
tmpdir: process.env.RUNNER_TEMP,
prefix: 'task-definition-',
postfix: '.json',
keep: true,
Expand Down
6 changes: 3 additions & 3 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Render task definition', () => {
.mockReturnValueOnce('nginx:latest'); // image

process.env = Object.assign(process.env, { GITHUB_WORKSPACE: __dirname });
process.env = Object.assign(process.env, { RUNNER_TEMP: '/tmp' });
process.env = Object.assign(process.env, { RUNNER_TEMP: '/home/runner/work/_temp' });

tmp.fileSync.mockReturnValue({
name: 'new-task-def-file-name'
Expand All @@ -45,7 +45,7 @@ describe('Render task definition', () => {
test('renders the task definition and creates a new task def file', async () => {
await run();
expect(tmp.fileSync).toHaveBeenNthCalledWith(1, {
dir: '/tmp',
tmpdir: '/home/runner/work/_temp',
prefix: 'task-definition-',
postfix: '.json',
keep: true,
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('Render task definition', () => {
await run();

expect(tmp.fileSync).toHaveBeenNthCalledWith(1, {
dir: '/tmp',
tmpdir: '/home/runner/work/_temp',
prefix: 'task-definition-',
postfix: '.json',
keep: true,
Expand Down

0 comments on commit a685a32

Please sign in to comment.