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

Skip to content

Commit 44bbe10

Browse files
committed
ci: Fix release workflow env vars
1 parent 41b58cd commit 44bbe10

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/release.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,17 @@ permissions:
3939
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
4040
id-token: write
4141

42-
env:
43-
CODER_RELEASE: ${{ !github.event.inputs.snapshot }}
44-
4542
concurrency: ${{ github.workflow }}-${{ github.ref }}
4643

4744
jobs:
4845
release:
4946
name: Create and publish
5047
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
5148
env:
49+
CODER_RELEASE: ${{ !github.event.inputs.snapshot }}
50+
CODER_RELEASE_INCREMENT: ${{ github.event.inputs.increment }}
51+
CODER_RELEASE_DRAFT: ${{ github.event.inputs.draft }}
52+
CODER_DRY_RUN: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}
5253
# Necessary for Docker manifest
5354
DOCKER_CLI_EXPERIMENTAL: "enabled"
5455
steps:
@@ -87,7 +88,7 @@ jobs:
8788
fi
8889
8990
version_args=()
90-
if [[ "${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}" == *t* ]]; then
91+
if [[ $CODER_DRY_RUN == *t* ]]; then
9192
# Allow dry-run of branches to pass.
9293
export CODER_IGNORE_MISSING_COMMIT_METADATA=1
9394
version_args+=(--dry-run)
@@ -104,7 +105,7 @@ jobs:
104105
./scripts/release/tag_version.sh \
105106
"${version_args[@]}" \
106107
--ref "$ref" \
107-
--${{ github.event.inputs.increment }}
108+
--"$CODER_RELEASE_INCREMENT"
108109
)"
109110
110111
# Generate notes.
@@ -232,10 +233,10 @@ jobs:
232233
set -euo pipefail
233234
234235
publish_args=()
235-
if [[ "${{ github.event.inputs.draft }}" == *t* ]]; then
236+
if [[ $CODER_RELEASE_DRAFT == *t* ]]; then
236237
publish_args+=(--draft)
237238
fi
238-
if [[ "${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}" == *t* ]]; then
239+
if [[ $CODER_DRY_RUN == *t* ]]; then
239240
publish_args+=(--dry-run)
240241
fi
241242
declare -p publish_args

scripts/release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ else
167167
fi
168168

169169
log
170-
gh workflow run release.yaml \
170+
# Use maybedryrun to echo the command.
171+
maybedryrun 0 gh workflow run release.yaml \
171172
--ref "$branch" \
172173
-F increment="$increment" \
174+
-F snapshot=false \
173175
"${args[@]}"
174176
log
175177

0 commit comments

Comments
 (0)