fix(ci): harden package-homebrew version extraction and SHA validation#96
Merged
zircote merged 2 commits intofix/homebrew-workflow-racefrom Feb 22, 2026
Merged
fix(ci): harden package-homebrew version extraction and SHA validation#96zircote merged 2 commits intofix/homebrew-workflow-racefrom
zircote merged 2 commits intofix/homebrew-workflow-racefrom
Conversation
3 tasks
- Add semver validation for workflow_run (tag ref check) and workflow_dispatch (input format check) version extraction - Expand SHA uniqueness guard from 3 binary assets to all 6 assets (ARM64, AMD64, Linux, completions, man pages, source tarball) - Replace wc -l with grep -c . for robust unique-SHA counting Co-authored-by: zircote <307960+zircote@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CI workflow run trigger for Homebrew packaging
fix(ci): harden package-homebrew version extraction and SHA validation
Feb 22, 2026
There was a problem hiding this comment.
Pull request overview
This PR hardens the package-homebrew.yml workflow by adding validation to prevent silent failures when triggered with invalid version references, and expands asset integrity checks to cover all downloaded artifacts.
Changes:
- Added semver format validation for both
workflow_run(tag-based) andworkflow_dispatch(manual input) trigger paths - Expanded SHA256 uniqueness verification from 3 binary assets to all 6 downloaded assets (binaries, completions, man pages, source tarball)
- Improved SHA counting robustness by replacing
wc -lwithgrep -c .to avoid off-by-one errors
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.
package-homebrew.ymlhad two gaps left from theworkflow_runmigration: version extraction silently accepted anyhead_branchvalue (including non-tag branch names), and the SHA uniqueness guard only covered the three binary assets, leaving completions, man pages, and source tarball downloads unchecked for 404 collisions.Changes
grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+...':workflow_run: exits with a descriptive error ifhead_branchisn't avX.Y.Ztag refworkflow_dispatch: strips an optional leadingv, then validates the remainder before proceedingARM64,AMD64,Linux,completions,man pages,source tarball); threshold raised from 3 → 6 unique valueswc -lwithgrep -c .to avoid off-by-one whensort -uoutput lacks a trailing newline💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.