Skip to content

Commit 9ae3f61

Browse files
adamanciniclaude
andcommitted
fix: update release-create task to use channel ID when available
- Modify release-create task to accept RELEASE_CHANNEL_ID parameter - Use channel ID for promotion when available, fall back to channel name - Update GitHub Actions to pass channel ID from previous step - Resolves "channel is ambiguous, please use channel ID" error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d16d4c8 commit 9ae3f61

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/actions/replicated-release/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ runs:
4242
working-directory: ${{ inputs.app-dir }}
4343
run: |
4444
task release-create \
45+
RELEASE_CHANNEL_ID="${{ steps.channel.outputs.channel-id }}" \
4546
RELEASE_CHANNEL="${{ inputs.channel-name }}" \
4647
RELEASE_VERSION="${{ inputs.release-version }}" \
4748
RELEASE_NOTES="${{ inputs.release-notes }}"

applications/wg-easy/Taskfile.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,21 +412,33 @@ tasks:
412412
- dependencies-update
413413

414414
release-create:
415-
desc: Create and promote a release using the Replicated CLI
415+
desc: Create and promote a release using the Replicated CLI (supports both channel names and IDs)
416416
run: once
417417
vars:
418418
RELEASE_CHANNEL: '{{.RELEASE_CHANNEL | default "Unstable"}}'
419+
RELEASE_CHANNEL_ID: '{{.RELEASE_CHANNEL_ID}}'
419420
RELEASE_VERSION: '{{.RELEASE_VERSION | default "0.0.1"}}'
420421
RELEASE_NOTES: '{{.RELEASE_NOTES | default "Release created via task release-create"}}'
422+
# Use channel ID if provided, otherwise fall back to channel name
423+
CHANNEL_TARGET: '{{if .RELEASE_CHANNEL_ID}}{{.RELEASE_CHANNEL_ID}}{{else}}{{.RELEASE_CHANNEL}}{{end}}'
421424
requires:
422-
vars: [APP_SLUG, RELEASE_CHANNEL, RELEASE_VERSION]
425+
vars: [APP_SLUG, RELEASE_VERSION]
423426
cmds:
424-
- echo "Creating and promoting release for {{.APP_SLUG}} to channel {{.RELEASE_CHANNEL}}..."
427+
- |
428+
if [ -n "{{.RELEASE_CHANNEL_ID}}" ]; then
429+
echo "Creating and promoting release for {{.APP_SLUG}} to channel ID {{.RELEASE_CHANNEL_ID}}..."
430+
else
431+
echo "Creating and promoting release for {{.APP_SLUG}} to channel {{.RELEASE_CHANNEL}}..."
432+
fi
425433
- |
426434
# Create and promote the release in one step
427435
echo "Creating release from files in ./release directory..."
428-
replicated release create --app {{.APP_SLUG}} --yaml-dir ./release --release-notes "{{.RELEASE_NOTES}}" --promote {{.RELEASE_CHANNEL}} --version {{.RELEASE_VERSION}}
429-
echo "Release version {{.RELEASE_VERSION}} created and promoted to channel {{.RELEASE_CHANNEL}}"
436+
replicated release create --app {{.APP_SLUG}} --yaml-dir ./release --release-notes "{{.RELEASE_NOTES}}" --promote {{.CHANNEL_TARGET}} --version {{.RELEASE_VERSION}}
437+
if [ -n "{{.RELEASE_CHANNEL_ID}}" ]; then
438+
echo "Release version {{.RELEASE_VERSION}} created and promoted to channel ID {{.RELEASE_CHANNEL_ID}}"
439+
else
440+
echo "Release version {{.RELEASE_VERSION}} created and promoted to channel {{.RELEASE_CHANNEL}}"
441+
fi
430442
deps:
431443
- release-prepare
432444

0 commit comments

Comments
 (0)