Repository navigation
Add --tag to release upload for parity with release create - #172
Open
CloudCorpRecords wants to merge 1 commit into
Open
CloudCorpRecords wants to merge 1 commit into
CloudCorpRecords wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
andrew
requested changes
Oct 15, 2026
andrew
left a comment
Contributor
There was a problem hiding this comment.
Please address these two points:
- In
internal/cli/release.go, explicitly empty--tagbypasses conflict validation:forge release upload --tag='' v1.0.0 app.zipaccepts the positional tag and proceeds to repository resolution. Checkcmd.Flags().Changed("tag")and reject empty flag values so an unset script variable cannot silently select positional mode. - In
internal/cli/release_test.go, the new tests only call the parser helper and check that the flag exists. Add tests through command execution for both supported forms and invalid combinations, including an empty--tag, and assert the tag and file contents passed toUploadAsset. This will cover flag binding and the upload path together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #168
forge release createtakes--tag, butforge release uploadonly accepted the tag positionally, which is awkward in scripts. This adds--tagtoupload:--tag, the single argument is the file; without it, the existing<tag> <file>form applies, so nothing breaks.--tagand a positional tag, no tag at all, or the wrong number of arguments gives a clear error.uploadTagAndFile, so it is unit-tested directly (7 cases), plus a test that the flag exists.I left
release download <tag> <asset-name>alone since the issue is about upload; happy to give it the same--tagtreatment in a follow-up if you want.Checks:
go test -race ./...andgolangci-lint runpass locally.This change was written with Claude Code (an AI coding agent); I ran the tests and linter above.