fix: handle empty homebrew-mumei repo in update-homebrew job#45
Merged
AkiraTamai merged 1 commit intodevelopfrom Mar 6, 2026
Merged
fix: handle empty homebrew-mumei repo in update-homebrew job#45AkiraTamai merged 1 commit intodevelopfrom
AkiraTamai merged 1 commit intodevelopfrom
Conversation
macos-13 has been retired by GitHub. macos-15-intel is the replacement Intel-based macOS runner for building x86_64 binaries. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
fix: handle empty homebrew-mumei repo in update-homebrew job
Summary
Fixes the
update-homebrewjob failing withfatal: couldn't find remote ref refs/heads/mainwhen themumei-lang/homebrew-mumeirepository is empty (has no branches).Root cause: The
actions/checkout@v4action assumes the target repo has a default branch. Thehomebrew-mumeirepo was empty, so fetchingrefs/heads/mainfailed repeatedly.What changed:
actions/checkout@v4with a manualgit clonethat falls back togit init -b main+git remote addwhen the repo is empty.peter-evans/create-pull-request@v6with a manualgit commit+git push origin HEAD:main. This pushes the formula directly tomaininstead of creating a PR, which is simpler for automated formula updates and works correctly for both empty and existing repos.Updates since last revision
homebrew-mumeirepo — replacesactions/checkout+peter-evans/create-pull-requestwith manual git commands that gracefully handle repos with no branches.Previous commits (already merged into develop via earlier PRs):
macos-13→macos-15-intelfor x86_64-apple-darwinReview & Testing Checklist for Human
HOMEBREW_TAP_TOKENsecret has push access tomumei-lang/homebrew-mumei. The workflow now pushes directly tomaininstead of creating a PR, so the token needs write/push permissions (not just PR creation).2>/dev/nullongit clonewon't mask auth errors. IfHOMEBREW_TAP_TOKENis invalid or expired, the clone will silently fail and fall back togit init, which will then fail at the push step. This is acceptable (the push step will surface the auth error) but worth being aware of.homebrew-mumeiviapeter-evans/create-pull-request. Now it pushes directly tomain. Confirm this is acceptable for your workflow — there will be no review step for formula updates.v0.2.11) after merging to trigger the release workflow and verify theupdate-homebrewjob succeeds. This cannot be tested locally.Test Plan
develop, then mergedevelopintomainv0.2.11)update-homebrewjob completes successfullymumei-lang/homebrew-mumeihas amainbranch with the generated formulaNotes
fatal: couldn't find remote ref refs/heads/main