@@ -42,15 +42,8 @@ permissions:
4242concurrency : ${{ github.workflow }}-${{ github.ref }}
4343
4444env :
45- # Use string semantics for negating the boolean, otherwise it will always
46- # be false. See https://github.com/actions/runner/issues/1483.
47- # Note that any time we need to do expressions, more than outputting the
48- # actual boolean value, it's safest to use `contains` because it casts the
49- # input to string, meaning we get the same behavior for true and 'true'.
50- # Boolean behavior differs between workflow_dispatch and workflow_call.
51- #
52- # Also note that inputs (vs github.event.inputs) are usable across both
53- # workflow_dispatch and workflow_call.
45+ # Use `inputs` (vs `github.event.inputs`) to ensure that booleans are actual
46+ # booleans, not strings.
5447 # https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/
5548 CODER_RELEASE : ${{ !inputs.snapshot }}
5649 CODER_RELEASE_INCREMENT : ${{ inputs.increment }}
7770 - name : Fetch git tags
7871 run : git fetch --tags --force
7972
80- - name : Test
81- run : |
82- echo ${{ inputs.dry_run && '--dry-run' || 'no dry' }}
83- echo ${{ inputs.dry_run && '--dry-run' || '' }}
84- echo ${{ inputs.dry_run && '--dry-run' }}
85- echo ${{ !inputs.dry_run && 'no dry' || '--dry-run'}}
86- echo ${{ (!inputs.dry_run && !inputs.snapshot) && 'release' || 'no release'}}
87- echo ${{ (inputs.dry_run || inputs.snapshot) && 'no release' || 'release'}}
88- exit 1
89-
9073 # Configure git user name/email for creating annotated version tag.
9174 - name : Setup git config
9275 run : |
@@ -286,8 +269,7 @@ jobs:
286269 uses : " google-github-actions/setup-gcloud@v1"
287270
288271 - name : Publish Helm Chart
289- # Do not publish helm charts for either dry run or snapshots.
290- if : ${{ contains(inputs.dry_run, 'false') && contains(inputs.snapshot, 'false') }}
272+ if : ${{ !inputs.dry_run && !inputs.snapshot }}
291273 run : |
292274 set -euo pipefail
293275 version="$(./scripts/version.sh)"
@@ -299,7 +281,7 @@ jobs:
299281 gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2
300282
301283 - name : Upload artifacts to actions (if dry-run or snapshot)
302- if : ${{ contains( inputs.dry_run, 'true') || contains( inputs.snapshot, 'true') }}
284+ if : ${{ inputs.dry_run || inputs.snapshot }}
303285 uses : actions/upload-artifact@v2
304286 with :
305287 name : release-artifacts
0 commit comments