feat(brew): add Homebrew installation support#164
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details🧰 Additional context used🪛 LanguageToolREADME.md[style] ~37-~37: Using many exclamation marks might seem excessive (in this case: 10 exclamation marks for a text that’s 3638 characters long) (EN_EXCESSIVE_EXCLAMATION) README.zh.md[style] ~36-~36: Using many exclamation marks might seem excessive (in this case: 9 exclamation marks for a text that’s 2539 characters long) (EN_EXCESSIVE_EXCLAMATION) 🪛 markdownlint-cli2 (0.22.1)README.md[warning] 35-35: Blank line inside blockquote (MD028, no-blanks-blockquote) [warning] 148-148: Images should have alternate text (alt text) (MD045, no-alt-text) README.zh.md[warning] 35-35: Blank line inside blockquote (MD028, no-blanks-blockquote) [warning] 148-148: Images should have alternate text (alt text) (MD045, no-alt-text) 🔇 Additional comments (6)
📝 WalkthroughWalkthroughAdds a release-triggered GitHub Actions workflow that updates the Homebrew tap formula (url and sha256) and documents Homebrew installation in English and Chinese READMEs; includes a small README-consistency test whitespace change and a modal HTML whitespace tweak. ChangesHomebrew Distribution Support
Sequence DiagramsequenceDiagram
participant Release as GitHub Release
participant Actions as GitHub Actions Runner
participant GHCLI as gh CLI
participant TapRepo as Homebrew Tap Repo (git)
Release->>Actions: release: published event (tag)
Actions->>GHCLI: gh release view / download asset (codexmate-<ver>-standalone.tar.gz)
Actions->>Actions: compute SHA256
Actions->>TapRepo: git clone / checkout main using HOMEBREW_TAP_TOKEN
Actions->>TapRepo: sed update `Formula/codexmate.rb` (url, sha256)
Actions->>TapRepo: git add/commit/push (if changes)
Actions->>Actions: write version/sha/url and formula to $GITHUB_STEP_SUMMARY
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/brew-update.yml (2)
8-9: ⚡ Quick winRemove unnecessary
contents: writepermission.This workflow writes only to the external tap repository (via
HOMEBREW_TAP_TOKEN), not to the current repository. Thecontents: writepermission is unnecessary and violates the principle of least privilege.🔒 Proposed fix to remove unnecessary permission
-permissions: - contents: writeOr if you need to be explicit:
permissions: - contents: write + contents: read🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/brew-update.yml around lines 8 - 9, Remove the unnecessary repository write permission by deleting the "contents: write" entry from the permissions block in the GitHub Actions workflow; this workflow only pushes to an external tap using HOMEBREW_TAP_TOKEN, so keep the permissions minimal (remove or replace the "permissions:" block with a more restrictive set if needed) and ensure no code or steps rely on repository contents write access.
63-72: 💤 Low valueConsider clearer control flow for the no-changes case.
The current
git diff --cached --quiet && echo "No changes to commit" && exit 0works correctly, but an explicitifstatement would make the intent clearer and improve readability.♻️ Optional refactor for clarity
- name: Commit and push env: VERSION: ${{ steps.ver.outputs.version }} run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add Formula/codexmate.rb - git diff --cached --quiet && echo "No changes to commit" && exit 0 - git commit -m "bump codexmate to v${VERSION}" - git push origin main + + if git diff --cached --quiet; then + echo "No changes to commit" + exit 0 + fi + + git commit -m "bump codexmate to v${VERSION}" + git push origin main🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/brew-update.yml around lines 63 - 72, In the "Commit and push" step replace the chained conditional with an explicit if block: run `if git diff --cached --quiet; then echo "No changes to commit"; exit 0; fi` before running `git commit -m "bump codexmate to v${VERSION}"` and `git push origin main` so the flow is clearer and the no-changes case is handled explicitly; update the commands in that step accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/brew-update.yml:
- Around line 23-29: The workflow step "Download standalone tarball" currently
runs gh release download with the pattern "codexmate-${{
steps.ver.outputs.version }}-standalone.tar.gz" and can fail cryptically if the
asset is missing or misnamed; update the step to first validate the asset exists
(e.g., use gh release view or gh api to list assets for
github.event.release.tag_name and check for the exact filename using
steps.ver.outputs.version) and if not found implement a short retry loop with
backoff (or fail with a clear message listing available asset names) before
calling gh release download; ensure the updated logic still uses GH_TOKEN and
preserves the download behavior when the asset is present.
- Around line 44-62: The sed replacements for url and sha256 in the "Update
formula" step can silently fail due to varying indentation; after running sed on
the formula variable, verify the update succeeded by checking the file contains
the expected url and SHA256 (e.g., grep or grep -q for the constructed url
variable and the SHA256 value) and exit non‑zero with a clear message if either
check fails; update the step to perform those verification checks using the
existing VERSION, SHA256, url, and formula variables so the workflow fails fast
instead of committing an unchanged Formula.
---
Nitpick comments:
In @.github/workflows/brew-update.yml:
- Around line 8-9: Remove the unnecessary repository write permission by
deleting the "contents: write" entry from the permissions block in the GitHub
Actions workflow; this workflow only pushes to an external tap using
HOMEBREW_TAP_TOKEN, so keep the permissions minimal (remove or replace the
"permissions:" block with a more restrictive set if needed) and ensure no code
or steps rely on repository contents write access.
- Around line 63-72: In the "Commit and push" step replace the chained
conditional with an explicit if block: run `if git diff --cached --quiet; then
echo "No changes to commit"; exit 0; fi` before running `git commit -m "bump
codexmate to v${VERSION}"` and `git push origin main` so the flow is clearer and
the no-changes case is handled explicitly; update the commands in that step
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f59def5d-3ff7-4e34-8f48-08f01e11230b
📒 Files selected for processing (3)
.github/workflows/brew-update.ymlREADME.mdREADME.zh.md
📜 Review details
🔇 Additional comments (6)
.github/workflows/brew-update.yml (2)
31-35: LGTM!
37-42: LGTM!README.md (2)
195-203: LGTM!
12-12: Anchor link is correct.The heading "Install via Homebrew (macOS / Linux)" at line 195 generates the GitHub anchor
#install-via-homebrew-macos--linux, which matches the badge link target. The link will work as expected.README.zh.md (2)
198-206: LGTM!
12-12: No action needed—the anchor link is correctly formatted.The badge link
#homebrew-安装macos--linuxcorrectly corresponds to the heading "Homebrew 安装(macOS / Linux)" per GitHub's anchor generation rules. GitHub preserves Chinese characters, removes parentheses and special characters like/, converts spaces to hyphens, and lowercases all text. The generated anchor matches the link precisely.
bead873 to
9ffba03
Compare
|
Updated this PR to unblock merge and address the review feedback. Changes made:
Local validation:
@coderabbitai re-review |
|
✅ Actions performedReview triggered.
|
awsl233777
left a comment
There was a problem hiding this comment.
Approved after resolving the main-branch conflicts, scoping the PR back to the Homebrew files, addressing the brew workflow review feedback, and verifying CI/local checks.
Summary
Add Homebrew tap (
SakuraByteCore/homebrew-codexmate) and auto-update workflow so macOS/Linux users can install viabrew install codexmate.SakuraByteCore/homebrew-codexmatewithFormula/codexmate.rb.github/workflows/brew-update.yml— auto-updates formula (version + SHA256) on each GitHub ReleaseREADME.md/README.zh.mdwith brew install instructions and badgeUsage (after next release with standalone tarball)
Setup required
SakuraByteCore/homebrew-codexmateHOMEBREW_TAP_TOKENinSakuraByteCore/codexmate→ Settings → Secrets and variables → ActionsTests
SakuraByteCore/homebrew-codexmatedesc,homepage,url,sha256,license,depends_on,install,test)codexmate-{ver}-standalone.tar.gz)cli.jsshebang (#!/usr/bin/env node) compatible with Homebrew'sdepends_on "node"brew tap+brew install— requires next release with standalone tarball +HOMEBREW_TAP_TOKENsecret configuredSummary by CodeRabbit
New Features
Documentation
Tests
Chores