From d4df406fd4831af60400cf5b383f6e4c2772eb86 Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Thu, 22 Feb 2024 18:03:51 +0100 Subject: [PATCH] Make RUNNER_OS available to if --- .github/workflows/publish.yml | 1 + composite/action.yml | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 010dae01..c3e881ec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,6 +10,7 @@ jobs: permissions: checks: write pull-requests: write +TODO: publish with linux / macos / windows actions steps: - name: Checkout diff --git a/composite/action.yml b/composite/action.yml index 88832551..3c971245 100644 --- a/composite/action.yml +++ b/composite/action.yml @@ -151,9 +151,14 @@ outputs: runs: using: 'composite' steps: + - name: Debug + run: | + echo "$RUNNER_OS" + echo "OS=$RUNNER_OS" >> "$GITHUB_ENV" + shell: bash - name: Run on Linux id: linux - if: startsWith(env.RUNNER_OS, 'Linux') + if: startsWith(env.OS, 'Linux') uses: EnricoMi/publish-unit-test-result-action/linux@branch-composite-os-actions-2 with: GITHUB_TOKEN: ${{ inputs.github_token }} @@ -202,7 +207,7 @@ runs: - name: Run on macOS id: macos - if: startsWith(env.RUNNER_OS, 'macOS') + if: startsWith(env.OS, 'macOS') uses: EnricoMi/publish-unit-test-result-action/macos@branch-composite-os-actions-2 with: GITHUB_TOKEN: ${{ inputs.github_token }} @@ -251,7 +256,7 @@ runs: - name: Run on Windows id: windows - if: startsWith(env.RUNNER_OS, 'Windows') + if: startsWith(env.OS, 'Windows') # for backward-compatibility (Windows used to be a bash script) # deprecated, remove in v3 # prefer to use $GITHUB_ACTION_PATH/../windows @@ -302,7 +307,7 @@ runs: LOG_LEVEL: ${{ inputs.log_level }} - name: Run on unsupported Operating System - if: ${{ ! (startsWith(env.RUNNER_OS, 'Linux') || startsWith(env.RUNNER_OS, 'macOS') || startsWith(env.RUNNER_OS, 'Windows')) }} + if: steps.linux.outcome == 'skipped' && steps.macos.outcome == 'skipped' && steps.windows.outcome == 'skipped' run: | echo "::error::Unsupported operating system: $RUNNER_OS" exit 1