From bcb0692ebb1bcc8720d441c34059af1edffe4769 Mon Sep 17 00:00:00 2001 From: Paul Hatcherian <1835615+PaulHatch@users.noreply.github.com> Date: Tue, 6 Oct 2020 20:45:54 -0400 Subject: [PATCH] Use OS specific temp folder for test repos --- index.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.test.js b/index.test.js index 31ed4c0..662133e 100644 --- a/index.test.js +++ b/index.test.js @@ -1,6 +1,7 @@ const cp = require('child_process'); const path = require('path'); const process = require('process'); +const os = require('os'); // Action input variables const defaultInputs = { @@ -13,7 +14,7 @@ const defaultInputs = { // Creates a randomly named git repository and returns a function to execute commands in it const createTestRepo = (inputs) => { - const repoDirectory = `/tmp/test${Math.random().toString(36).substring(2, 15)}`; + const repoDirectory = path.join(os.tmpdir(), `test${Math.random().toString(36).substring(2, 15)}`); cp.execSync(`mkdir ${repoDirectory}`); cp.execSync(`git init ${repoDirectory}`);