From 8f5c1a6a1304abe67cc44708f05a92f4c9c5318b Mon Sep 17 00:00:00 2001 From: Jordan Jacobelli Date: Wed, 25 Oct 2023 12:08:15 +0200 Subject: [PATCH] Use env.RUNNER_ENVIRONMENT to check runner type Signed-off-by: Jordan Jacobelli --- .github/actions/devcontainer-json/action.yml | 4 ++-- .github/actions/setup-runner-env/action.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/devcontainer-json/action.yml b/.github/actions/devcontainer-json/action.yml index 2185dde10..1c6238429 100644 --- a/.github/actions/devcontainer-json/action.yml +++ b/.github/actions/devcontainer-json/action.yml @@ -21,8 +21,8 @@ runs: using: composite steps: - - name: Setup Node.js - if: contains(runner.name, 'linux-') == true + - if: env.RUNNER_ENVIRONMENT != "github-hosted" + name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '16' diff --git a/.github/actions/setup-runner-env/action.yml b/.github/actions/setup-runner-env/action.yml index f0f98ee73..39b9a7b3e 100644 --- a/.github/actions/setup-runner-env/action.yml +++ b/.github/actions/setup-runner-env/action.yml @@ -6,26 +6,26 @@ runs: using: composite steps: - - if: contains(runner.name, 'linux-') != true + - if: env.RUNNER_ENVIRONMENT == "github-hosted" name: Free up disk space uses: ./.github/actions/free-disk-space with: tool_cache: "${{ runner.tool_cache }}" - - if: contains(runner.name, 'linux-') == true + - if: env.RUNNER_ENVIRONMENT != "github-hosted" name: Setup self-hosted runner environment shell: bash -eo pipefail {0} run: | echo "HOME=${{ runner.workspace }}" >> $GITHUB_ENV; echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV; - - if: contains(runner.name, 'linux-') == true + - if: env.RUNNER_ENVIRONMENT != "github-hosted" name: Setup Node.js uses: actions/setup-node@v3 with: node-version: '16' - - if: contains(runner.name, 'linux-') != true + - if: env.RUNNER_ENVIRONMENT == "github-hosted" name: Set up QEMU uses: docker/setup-qemu-action@v2