From 33dfad703e75227b13cf951889fdff061106d675 Mon Sep 17 00:00:00 2001 From: Thomas Boop Date: Mon, 28 Sep 2020 16:50:43 -0400 Subject: [PATCH 1/2] swap to file commands --- .github/workflows/artifact-tests.yml | 5 +++-- .../artifact/__tests__/ci-test-action/index.js | 15 ++++++++++++--- packages/cache/__tests__/__fixtures__/index.js | 15 ++++++++++++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/artifact-tests.yml b/.github/workflows/artifact-tests.yml index ef9a17d12d..2067461f0d 100644 --- a/.github/workflows/artifact-tests.yml +++ b/.github/workflows/artifact-tests.yml @@ -46,9 +46,10 @@ jobs: working-directory: packages/artifact - name: Set artifact file contents + shell: bash run: | - echo "::set-env name=non-gzip-artifact-content::hello" - echo "::set-env name=gzip-artifact-content::Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" + echo "non-gzip-artifact-content=hello" >> $GITHUB_ENV + echo "gzip-artifact-content=Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" >> $GITHUB_ENV - name: Create files that will be uploaded run: | diff --git a/packages/artifact/__tests__/ci-test-action/index.js b/packages/artifact/__tests__/ci-test-action/index.js index e2ff6aea20..79094c6637 100644 --- a/packages/artifact/__tests__/ci-test-action/index.js +++ b/packages/artifact/__tests__/ci-test-action/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 upload and download artifacts 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 +import * as fs from 'fs' +import * as os from '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 diff --git a/packages/cache/__tests__/__fixtures__/index.js b/packages/cache/__tests__/__fixtures__/index.js index 82bc6c43e5..5e662716a8 100644 --- a/packages/cache/__tests__/__fixtures__/index.js +++ b/packages/cache/__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 +import * as fs from 'fs' +import * as os from '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 From 20dcada5f2a76eb8bb1a127f366d1ca319e52cf6 Mon Sep 17 00:00:00 2001 From: Thomas Boop Date: Mon, 28 Sep 2020 16:54:11 -0400 Subject: [PATCH 2/2] swap to require --- packages/artifact/__tests__/ci-test-action/index.js | 4 ++-- packages/cache/__tests__/__fixtures__/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/artifact/__tests__/ci-test-action/index.js b/packages/artifact/__tests__/ci-test-action/index.js index 79094c6637..de108a5590 100644 --- a/packages/artifact/__tests__/ci-test-action/index.js +++ b/packages/artifact/__tests__/ci-test-action/index.js @@ -1,7 +1,7 @@ // 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 upload and download artifacts e2e in a shell when running CI tests, we need these env variables set -import * as fs from 'fs' -import * as os from 'os' +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' diff --git a/packages/cache/__tests__/__fixtures__/index.js b/packages/cache/__tests__/__fixtures__/index.js index 5e662716a8..2b21bf800b 100644 --- a/packages/cache/__tests__/__fixtures__/index.js +++ b/packages/cache/__tests__/__fixtures__/index.js @@ -1,7 +1,7 @@ // 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 -import * as fs from 'fs' -import * as os from 'os' +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'