Fail release build if box.json version can't be read - #58
Merged
Merged
Conversation
The version-extraction step used backtick command substitution around jq, so a jq parse failure (or any other error) silently produced an empty VERSION instead of failing the step. This let a release proceed with an empty version, tagging the repo as "v", publishing "+<build>" to ForgeBox, and then hard-failing later in the GitHub Release step with an unrelated-looking error. Use jq -e (non-zero exit on null/failure) and explicitly fail the step if VERSION ends up empty.
2 tasks
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.
Summary
The last release run on
maintagged the repo asv(empty version), publishedcbfs+9to ForgeBox instead of a proper semver, and then hard-failed in the GitHub Release step (INPUT_TITLE: parameter null or not set).Root cause
box.jsononmainhad a trailing comma in itsscriptsobject (invalid strict JSON, though CommandBox's own parser tolerates it). The release workflow's version-extraction step:used backtick command substitution around
jq. Whenjqfailed to parse the malformed JSON, the substitution silently produced an empty string, and the step still exited 0 — soVERSIONwas empty for the rest of the job with no visible failure until the GitHub Release step choked on it much later.(
main'sbox.jsontrailing comma will be fixed in a separate PR targetingmaindirectly, since it isn't part ofdevelopment's history.development's ownbox.jsonis already clean — the automatedbox bump --minorstep rewrites it with CommandBox's own serializer, which doesn't emit trailing commas.)Fix
Use
jq -e(non-zero exit on anull/parse-failure result) and explicitly fail the step with::error::ifVERSIONends up empty, so a broken version is caught before anything gets tagged, published, or released.Test plan
maincompletes with a real version, or fails fast at the "Setup Environment Variables For Build Process" step ifbox.jsonis ever malformed again🤖 Generated with Claude Code
https://claude.ai/code/session_01MY8vKDaEubRApVMT9BXSYk
Generated by Claude Code