Skip to content

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

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

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

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'
env:
L: ${{ '${{' }}
R: '}}'
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: '${{ env.L }} inputs.empty_string ${{ env.R }}'
if: ${{ inputs.empty_string }}
run: echo
- name: '${{ env.L }} inputs.empty_string == '''' ${{ env.R }}'
if: ${{ inputs.empty_string == '' }}
run: echo
- name: '${{ env.L }} inputs.empty_string != '''' ${{ env.R }}'
if: ${{ inputs.empty_string != '' }}
run: echo
- name: '${{ env.L }} inputs.empty_string == ''arg'' ${{ env.R }}'
if: ${{ inputs.empty_string == 'arg' }}
run: echo
- name: '${{ env.L }} inputs.empty_string != ''arg'' ${{ env.R }}'
if: ${{ inputs.empty_string != 'arg' }}
run: echo