feat(cli): commit Homebrew formula updates directly - #1698
Merged
Conversation
Contributor
Greptile SummaryThe workflow now publishes Homebrew formula updates directly to the tap.
Confidence Score: 3/5The PR is not yet safe to merge because concurrent releases can still make the later Homebrew formula update fail during rebase. The workflow has no concurrency control and commits formula changes before rebasing, so two release runs that update the same version and checksum lines can conflict and leave the tap pinned to the earlier release. Files Needing Attention: templates/cli/.github/workflows/publish.yml Important Files Changed
Reviews (4): Last reviewed commit: "feat(cli): commit Homebrew formula updat..." | Re-trigger Greptile |
ChiragAgg5k
force-pushed
the
feat/cli-homebrew-direct-commit
branch
2 times, most recently
from
July 28, 2026 05:08
d461c2d to
798b76e
Compare
The publish workflow opened a pull request against the tap for every release, which then sat waiting for a human before brew users could get the new version. Commit to the tap's default branch instead. Drops the last use of the bot token for pull requests, so the app only needs Contents: write and Metadata: read on the tap.
ChiragAgg5k
force-pushed
the
feat/cli-homebrew-direct-commit
branch
from
July 28, 2026 05:11
798b76e to
cb9e584
Compare
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.
What does this PR do?
Makes the CLI publish workflow commit Homebrew formula updates straight to the tap's default branch instead of opening a pull request.
Every release previously opened a PR against
appwrite/homebrew-appwritethat then waited on a human, sobrew install appwritelagged behind npm and the GitHub release until someone merged it.Changes
templates/cli/.github/workflows/publish.yml— "Open pull request on Homebrew tap" becomes "Commit Homebrew formula update": commit to the checked-out default branch and push. It rebases onto the remote first, since another release can land between checkout and push, where the old code force-pushed a per-release branch and that was harmless.The early-exit when the formula is already current is preserved. Checksums still come from the local build, unchanged.
Why not an off-the-shelf action
Both mainstream options were checked and neither fits:
mislav/bump-homebrew-formula-actionupdatesversion,url,sha256,tag,revision— a singleurl/sha256pair. It does support direct commits (create-pullrequest: false), but it requiresCOMMITTER_TOKEN, a classic PAT withreposcope. That is broader and user-tied, a step back from the GitHub App this workflow already uses.dawidd6/action-homebrew-bump-formulawrapsbrew bump-formula-pr, takingtag/revisionfor a single source, and is pull-request shaped by design.Both assume the common case: one source tarball, one checksum. This formula is a prebuilt multi-arch binary formula with four URLs across
on_macos/on_linux× arm64/x64, each with its ownsha256, and the URLs interpolate#{version}so they never literally change — onlyversionand the four checksums do. Neither action can express that.On losing the review step
Worth stating explicitly, since dropping the PR removes the only human look at those four checksums: the safety property does not come from the review, it comes from where the checksums are derived. They are hashed from the binaries this workflow just built, so the formula attests "this is the artifact we built." If anything differs from what ends up published,
brewfails the checksum and refuses to install.That also rules out an obvious-looking alternative: hashing the published assets instead. It sounds safer, but it makes the formula certify whatever is on the release, so a corrupted upload would get a checksum matching it and
brewwould install the corrupted binary silently. Hashing the build keeps the failure loud.Permissions
This removes the last use of the bot token for pull requests. The app now needs only:
Pull requests: writecan be dropped, so this is strictly less access than before.Note the tap's
mainis currently unprotected, which is what makes a direct push work. If branch protection requiring a PR is ever enabled there, the push will fail in a way that looks like a permissions problem but is not — the app would need adding to the "allow specified actors to bypass required pull requests" list.Test Plan
ruby -ryamlparses the workflow; 21 steps load, ending in the new commit step.runblock passesbash -n.php example.php cli consoleregenerates cleanly; the generated.github/workflows/publish.ymlis byte-identical to the template, confirming thecopyscope passes it through unchanged.composer refactor:check— Rector clean.composer lint-twig— 44 errors with and without this change; all pre-existing, none in the touched file.gh prusage or bot-tokenGH_TOKENremains in the Homebrew steps.Related PRs and Issues
Follow-up to appwrite/sdk-for-cli#346. The 23.2.0 publish run failed at the Homebrew step because
vars.APPWRITE_BOT_APP_IDandsecrets.APPWRITE_BOT_PRIVATE_KEYare not set onsdk-for-cli, so the formula had to be bumped by hand in appwrite/homebrew-appwrite#32. That credential gap is separate from this change and still needs fixing, or this step will keep failing before it can commit anything.Have you read the Contributing Guidelines on issues?
Yes.