Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use new tmp dir options in upgraded library #29

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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