fix: write .version directly instead of hardcoding the version in urls - #98
Merged
Conversation
ci/bump_homebrew_formula.rb now writes Formula/linear-cli/.version to
the release tag directly (the formula's own single source of truth,
per rubyists/homebrew-tap's matching change) instead of rewriting a
literal version number inside each url - the url lines are now a
constant `v#{version}/<asset>` in the formula's own source, so only
the sha256 that follows each one actually needs updating per release.
Verified against a real copy of the formula: correct .version/sha256
output, url lines left untouched, idempotent on a repeated run with
the same inputs, and the resulting formula evaluates to the correct
version/url/sha256 via a small Homebrew-Formula-DSL stub.
Also bumps the vendor/rubyists-homebrew-tap submodule pointer to the
merged fix (rubyists/homebrew-tap#6).
There was a problem hiding this comment.
Pull request overview
Updates the Homebrew formula bump script so releases are driven by the formula’s .version file (as the single source of truth) and only sha256 entries are updated, leaving url lines untouched because they interpolate #{version}.
Changes:
- Write
Formula/linear-cli/.versionbased on the provided release tag. - Update per-platform
sha256values by matching the formula’s constantv#{version}/<asset>URL pattern. - Simplify the substitution logic to only replace the checksum portion of each
url/sha256pair.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Copilot's review on #98 flagged three real issues in ci/bump_homebrew_formula.rb, all verified against the actual behavior before fixing: - TAG's "v" prefix was assumed, never validated - a bare "1.5.0" would silently write a .version that doesn't match what the formula's hardcoded v#{version} url actually requests. Now aborts loudly if TAG doesn't start with "v". - .version was written before the validation loop that can abort on a missing checksum or pattern mismatch, so a failure mid-run could leave .version bumped while the formula's actual sha256/url stayed on the old release. Both writes now happen only after every asset's checked and every pattern's matched. - The sha256 match pattern accepted any-length hex ([a-f0-9]+) instead of exactly 64 chars, risking a match against malformed content. Tightened to [a-fA-F0-9]{64}.
…byists/linear-cli into fix-homebrew-bump-version-file
bougyman
pushed a commit
that referenced
this pull request
Aug 13, 2026
🤖 I have created a release *beep* *boop* --- ## [1.4.1](v1.4.0...v1.4.1) (2026-08-12) ### Bug Fixes * write .version directly instead of hardcoding the version in urls ([#98](#98)) ([170ba1e](170ba1e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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
ci/bump_homebrew_formula.rbnow writesFormula/linear-cli/.versionto the release tag directly (the formula's own single source of truth, per fix: derive the formula's version from .version instead of duplicating it homebrew-tap#6's matching change) instead of rewriting a literal version number inside eachurl- theurllines are now a constantv#{version}/<asset>in the formula's own source, so only thesha256that follows each one actually needs updating per release.vendor/rubyists-homebrew-tapsubmodule pointer to the merged fix (fix: derive the formula's version from .version instead of duplicating it homebrew-tap#6).Test plan
.version/sha256output,urllines left untouchedversion/url/sha256via a small Homebrew-Formula-DSL stubactionlintclean onmain.yamlmix format --check-formatted/mix usage_rules.sync --checkclean inapp/🤖 Generated with Claude Code