Computer scienceSystem administration and DevOpsCI/CD processesGitHub Actions

Conditional execution

Runner

Report a typo

What is the output of the workflow file?

name: RUNNER
on: push
jobs:
  if-Windows-else:
    runs-on: ubuntu-latest
    steps:
      - name: condition 1
        if: runner.os == 'Windows'
        run: echo "The operating system on the runner is $env:RUNNER_OS."
      - name: condition 2
        if: runner.os != 'Windows'
        run: echo "The operating system on the runner is not Windows, it's $RUNNER_OS."
Enter a short text
___

Create a free account to access the full topic