Test GHA "if" expressions (actions/runner#1173) #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: '${{' | ||
Check failure on line 13 in .github/workflows/ifs.yml
|
||
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 |