Skip to content

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

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

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

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 GHA "if" expressions (actions/runner#1173)'
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'' }}"

Check failure on line 45 in .github/workflows/ifs.yml

View workflow run for this annotation

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

Invalid workflow file

The workflow is not valid. .github/workflows/ifs.yml (Line: 45, Col: 15): Unexpected symbol: 'arg'''. Located at position 26 within expression: inputs.empty_string == ''arg'' .github/workflows/ifs.yml (Line: 48, Col: 15): Unexpected symbol: 'arg'''. Located at position 26 within expression: inputs.empty_string != ''arg''
if: ${{ inputs.empty_string == 'arg' }}
run: echo
- name: "${{ inputs.empty_string != ''arg'' }}"
if: ${{ inputs.empty_string != 'arg' }}
run: echo