48
48
# actual boolean value, it's safest to use `contains` because it casts the
49
49
# input to string, meaning we get the same behavior for true and 'true'.
50
50
# Boolean behavior differs between workflow_dispatch and workflow_call.
51
- CODER_RELEASE : ${{ contains(github.event.inputs.snapshot, 'false') }}
52
- CODER_RELEASE_INCREMENT : ${{ github.event.inputs.increment }}
53
- CODER_RELEASE_DRAFT : ${{ github.event.inputs.draft }}
54
- CODER_DRY_RUN : ${{ contains(github.event.inputs.dry_run, 'true') || contains(github.event.inputs.snapshot, 'true') }}
51
+ #
52
+ # Also note that inputs (vs github.event.inputs) are usable across both
53
+ # workflow_dispatch and workflow_call.
54
+ # https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/
55
+ CODER_RELEASE : ${{ contains(inputs.snapshot, 'false') }}
56
+ CODER_RELEASE_INCREMENT : ${{ inputs.increment }}
57
+ CODER_RELEASE_DRAFT : ${{ inputs.draft }}
58
+ CODER_DRY_RUN : ${{ contains(inputs.dry_run, 'true') || contains(inputs.snapshot, 'true') }}
55
59
56
60
jobs :
57
61
release :
85
89
ref=HEAD
86
90
old_version="$(git describe --abbrev=0 "$ref^1")"
87
91
88
- if [[ "${{ github.event. inputs.ignore_missing_commit_metadata }}" == *t* ]]; then
92
+ if [[ "${{ inputs.ignore_missing_commit_metadata }}" == *t* ]]; then
89
93
export CODER_IGNORE_MISSING_COMMIT_METADATA=1
90
94
fi
91
95
@@ -273,7 +277,7 @@ jobs:
273
277
274
278
- name : Publish Helm Chart
275
279
# Do not publish helm charts for either dry run or snapshots.
276
- if : ${{ contains(github.event. inputs.dry_run, 'false') && contains(github.event. inputs.snapshot, 'false') }}
280
+ if : ${{ contains(inputs.dry_run, 'false') && contains(inputs.snapshot, 'false') }}
277
281
run : |
278
282
set -euo pipefail
279
283
version="$(./scripts/version.sh)"
@@ -285,7 +289,7 @@ jobs:
285
289
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2
286
290
287
291
- name : Upload artifacts to actions (if dry-run or snapshot)
288
- if : ${{ contains(github.event. inputs.dry_run, 'true') || contains(github.event. inputs.snapshot, 'true') }}
292
+ if : ${{ contains(inputs.dry_run, 'true') || contains(inputs.snapshot, 'true') }}
289
293
uses : actions/upload-artifact@v2
290
294
with :
291
295
name : release-artifacts
0 commit comments