From aec14e5cf34bbb96720e303c32e1cae3fc884169 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Thu, 25 Nov 2021 09:07:45 +0100 Subject: [PATCH] Disabled `FORCE_COLOR` on `setup-node` GitHub Action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Ghost/pull/13716 refs https://github.com/actions/setup-node/issues/317#issuecomment-929694556 - the `setup-node` GitHub Action seems to use a shell command to get the cache path, but these are colorised when `FORCE_COLOR` is enabled - this causes the Action to fail to read the path correctly - the comment referenced above suggests to remove `FORCE_COLOR` but it's nice to have colored output for our tests - instead, I'm disabling the environment variable on the `setup-node` action so it still works - I've tested with the referenced PR and this unblocks dependency caching 🎉 --- .github/workflows/canary.yml | 2 ++ .github/workflows/release.yml | 2 ++ .github/workflows/test.yml | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 3f9f8136b58c..4cb0da47fa41 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -12,6 +12,8 @@ jobs: fetch-depth: 0 submodules: true - uses: actions/setup-node@v2 + env: + FORCE_COLOR: 0 with: node-version: '14.17.0' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d31de0ae8a24..ba4b0f762caf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,6 +17,8 @@ jobs: fetch-depth: 0 submodules: true - uses: actions/setup-node@v2 + env: + FORCE_COLOR: 0 with: node-version: '14' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 264d4e9a3053..66a1527f86f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 + env: + FORCE_COLOR: 0 with: node-version: '14.17.0' - run: yarn @@ -49,6 +51,8 @@ jobs: fetch-depth: 0 submodules: true - uses: actions/setup-node@v2 + env: + FORCE_COLOR: 0 with: node-version: '14.17.0' @@ -90,6 +94,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 + env: + FORCE_COLOR: 0 with: node-version: ${{ matrix.node }} @@ -174,6 +180,8 @@ jobs: fetch-depth: 0 submodules: true - uses: actions/setup-node@v2 + env: + FORCE_COLOR: 0 with: node-version: '12.22.1' - run: npm install -g ghost-cli@latest