From 8bc0f01ca37aa896283dabd73368287cdfb440c1 Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Wed, 30 Sep 2020 09:46:54 -0400 Subject: [PATCH] swap to file commands (#587) * swap to file commands * swap to require --- __tests__/__fixtures__/index.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/__tests__/__fixtures__/index.js b/__tests__/__fixtures__/index.js index 82bc6c4..2b21bf8 100644 --- a/__tests__/__fixtures__/index.js +++ b/__tests__/__fixtures__/index.js @@ -1,5 +1,14 @@ // Certain env variables are not set by default in a shell context and are only available in a node context from a running action // In order to be able to restore and save cache e2e in a shell when running CI tests, we need these env variables set -console.log(`::set-env name=ACTIONS_RUNTIME_URL::${process.env.ACTIONS_RUNTIME_URL}`) -console.log(`::set-env name=ACTIONS_RUNTIME_TOKEN::${process.env.ACTIONS_RUNTIME_TOKEN}`) -console.log(`::set-env name=GITHUB_RUN_ID::${process.env.GITHUB_RUN_ID}`) \ No newline at end of file +const fs = require('fs'); +const os = require('os'); +const filePath = process.env[`GITHUB_ENV`] +fs.appendFileSync(filePath, `ACTIONS_RUNTIME_URL=${process.env.ACTIONS_RUNTIME_URL}${os.EOL}`, { + encoding: 'utf8' +}) +fs.appendFileSync(filePath, `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}${os.EOL}`, { + encoding: 'utf8' +}) +fs.appendFileSync(filePath, `GITHUB_RUN_ID=${process.env.GITHUB_RUN_ID}${os.EOL}`, { + encoding: 'utf8' +}) \ No newline at end of file