Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eff3735

Browse files
committed
use contains
1 parent 88a30af commit eff3735

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ env:
4646
# be false. See https://github.com/actions/runner/issues/1483.
4747
# Note that boolean behavior differs between workflow_dispatch and
4848
# workflow_call.
49-
CODER_RELEASE: ${{ github.event.inputs.snapshot == 'false' || github.event.inputs.snapshot == false }}
49+
CODER_RELEASE: ${{ contains(github.event.inputs.snapshot, 'false') }}
5050
CODER_RELEASE_INCREMENT: ${{ github.event.inputs.increment }}
5151
CODER_RELEASE_DRAFT: ${{ github.event.inputs.draft }}
52-
CODER_DRY_RUN: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}
52+
CODER_DRY_RUN: ${{ contains(github.event.inputs.dry_run, 'true') || contains(github.event.inputs.snapshot, 'true') }}
5353

5454
jobs:
5555
release:
@@ -126,6 +126,15 @@ jobs:
126126
127127
- name: Test
128128
run: |
129+
echo ${{ contains(github.event.inputs.dry_run, 'true') || contains(github.event.inputs.snapshot, 'true') }}
130+
echo ${{ contains(github.event.inputs.dry_run, 'false') || contains(github.event.inputs.snapshot, 'false') }}
131+
echo ${{ contains(github.event.inputs.dry_run, 'true') && contains(github.event.inputs.snapshot, 'true') }}
132+
echo ${{ contains(github.event.inputs.dry_run, 'false') && contains(github.event.inputs.snapshot, 'false') }}
133+
echo ${{ contains(github.event.inputs.dry_run, 'true') || contains(github.event.inputs.snapshot, 'false') }}
134+
echo ${{ contains(github.event.inputs.dry_run, 'false') || contains(github.event.inputs.snapshot, 'true') }}
135+
echo ${{ contains(github.event.inputs.dry_run, 'true') && contains(github.event.inputs.snapshot, 'false') }}
136+
echo ${{ contains(github.event.inputs.dry_run, 'false') && contains(github.event.inputs.snapshot, 'true') }}
137+
129138
echo ${{ (github.event.inputs.dry_run == 'false' || github.event.inputs.dry_run == false) && (github.event.inputs.snapshot == 'false' || github.event.inputs.snapshot == false) }}
130139
echo ${{ (github.event.inputs.dry_run == 'true' || github.event.inputs.dry_run == true) && (github.event.inputs.snapshot == 'true' || github.event.inputs.snapshot == true) }}
131140
echo ${{ github.event.inputs.dry_run == 'false' && github.event.inputs.snapshot == 'false' }}
@@ -137,7 +146,7 @@ jobs:
137146
echo ${{ !github.event.inputs.dry_run || !github.event.inputs.snapshot }}
138147
139148
- name: Test if
140-
if: ${{ github.event.inputs.dry_run == 'false' && github.event.inputs.snapshot == 'false' }}
149+
if: ${{ contains(github.event.inputs.dry_run, 'false') && contains(github.event.inputs.snapshot, 'false') }}
141150
run: |
142151
echo Hello
143152

0 commit comments

Comments
 (0)