Skip to content

Test GHA "if" expressions (actions/runner#1173) #2

Test GHA "if" expressions (actions/runner#1173)

Test GHA "if" expressions (actions/runner#1173) #2

Workflow file for this run

# See https://github.com/actions/runner/issues/1173
name: 'Test GHA "if" expressions (actions/runner#1173)'
on:
workflow_dispatch:
inputs:
empty_string:
description: 'Empty string'
default: ''
arg:
description: 'Argument'
default: 'arg'
jobs:
test:
name: Test ${{ inputs.runs-on || 'ubuntu-latest' }}
runs-on: ubuntu-latest
steps:
# Empty string comparisons, expressions inlined
- name: 'inputs.empty_string'
if: inputs.empty_string
run: echo
- name: 'inputs.empty_string == '''''
if: inputs.empty_string == ''
run: echo
- name: 'inputs.empty_string != '''''
if: inputs.empty_string != ''
run: echo
- name: 'inputs.empty_string == ''arg'''
if: inputs.empty_string == 'arg'
run: echo
- name: 'inputs.empty_string != ''arg'''
if: inputs.empty_string != 'arg'
run: echo
# Empty string comparisons, wrapped in ${{ … }}
- name: '${{ inputs.empty_string }}'
if: ${{ inputs.empty_string }}
run: echo
- name: '${{ inputs.empty_string == '''' }}'
if: ${{ inputs.empty_string == '' }}
run: echo
- name: '${{ inputs.empty_string != '''' }}'
if: ${{ inputs.empty_string != '' }}
run: echo
- name: '${{ inputs.empty_string == ''arg'' }}'
if: ${{ inputs.empty_string == 'arg' }}
run: echo
- name: '${{ inputs.empty_string != ''arg'' }}'
if: ${{ inputs.empty_string != 'arg' }}
run: echo