Skip to content

Commit

Permalink
Make env.RUNNER_OS available to if
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Feb 22, 2024
1 parent 98bfe86 commit 0b1a511
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions composite/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0b1a511

Please sign in to comment.