-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (84 loc) · 2.83 KB
/
ifs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# See https://github.com/actions/runner/issues/1173
name: 'Test GHA "if" expressions (actions/runner#1173)'
on:
workflow_dispatch:
inputs:
empty:
description: 'Empty string'
default: ''
nonempty:
description: 'Non-empty string'
default: 'nonempty'
env:
# Escaped for use in step names; h/t https://github.com/orgs/community/discussions/26621#discussioncomment-3252557
L: ${{ '${{' }}
R: '}}'
jobs:
test-empty:
name: 'Empty-string "if"s'
runs-on: ubuntu-latest
steps:
- name: 'if: inputs.empty'
if: inputs.empty
run: echo
- name: 'if: ${{ env.L }} inputs.empty ${{ env.R }}'
if: ${{ inputs.empty }}
run: echo
- name: 'if: inputs.empty != '''''
if: inputs.empty != ''
run: echo
- name: 'if: ${{ env.L }} inputs.empty != '''' ${{ env.R }}'
if: ${{ inputs.empty != '' }}
run: echo
- name: 'if: inputs.empty == ''nonempty'''
if: inputs.empty == 'nonempty'
run: echo
- name: 'if: ${{ env.L }} inputs.empty == ''nonempty'' ${{ env.R }}'
if: ${{ inputs.empty == 'nonempty' }}
run: echo
- name: 'if: inputs.empty == '''''
if: inputs.empty == ''
run: echo
- name: 'if: ${{ env.L }} inputs.empty == '''' ${{ env.R }}'
if: ${{ inputs.empty == '' }}
run: echo
- name: 'if: inputs.empty != ''nonempty'''
if: inputs.empty != 'nonempty'
run: echo
- name: 'if: ${{ env.L }} inputs.empty != ''nonempty'' ${{ env.R }}'
if: ${{ inputs.empty != 'nonempty' }}
run: echo
test-nonempty:
name: 'Non-empty-string "if"s'
runs-on: ubuntu-latest
steps:
- name: 'if: inputs.nonempty'
if: inputs.nonempty
run: echo
- name: 'if: ${{ env.L }} inputs.nonempty ${{ env.R }}'
if: ${{ inputs.nonempty }}
run: echo
- name: 'if: inputs.nonempty != '''''
if: inputs.nonempty != ''
run: echo
- name: 'if: ${{ env.L }} inputs.nonempty != '''' ${{ env.R }}'
if: ${{ inputs.nonempty != '' }}
run: echo
- name: 'if: inputs.nonempty == ''nonempty'''
if: inputs.nonempty == 'nonempty'
run: echo
- name: 'if: ${{ env.L }} inputs.nonempty == ''nonempty'' ${{ env.R }}'
if: ${{ inputs.nonempty == 'nonempty' }}
run: echo
- name: 'if: inputs.nonempty == '''''
if: inputs.nonempty == ''
run: echo
- name: 'if: ${{ env.L }} inputs.nonempty == '''' ${{ env.R }}'
if: ${{ inputs.nonempty == '' }}
run: echo
- name: 'if: inputs.nonempty != ''nonempty'''
if: inputs.nonempty != 'nonempty'
run: echo
- name: 'if: ${{ env.L }} inputs.nonempty != ''nonempty'' ${{ env.R }}'
if: ${{ inputs.nonempty != 'nonempty' }}
run: echo