From 9a93d23fa6a021a3c69b69f27b9e9c1f45cdfb2d Mon Sep 17 00:00:00 2001 From: Clare Liguori Date: Mon, 11 May 2020 15:33:52 -0700 Subject: [PATCH] fix: use new tmp dir options in upgraded library --- index.js | 2 +- index.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 6793123a..ec9b78c8 100644 --- a/index.js +++ b/index.js @@ -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, diff --git a/index.test.js b/index.test.js index 42f3dcba..379d5706 100644 --- a/index.test.js +++ b/index.test.js @@ -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' @@ -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, @@ -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,