Skip to content

fix: handle empty homebrew-mumei repo in update-homebrew job#45

Merged
AkiraTamai merged 1 commit intodevelopfrom
devin/1772815058-fix-macos-intel-runner
Mar 6, 2026
Merged

fix: handle empty homebrew-mumei repo in update-homebrew job#45
AkiraTamai merged 1 commit intodevelopfrom
devin/1772815058-fix-macos-intel-runner

Conversation

@AkiraTamai
Copy link
Copy Markdown
Collaborator

@AkiraTamai AkiraTamai commented Mar 6, 2026

fix: handle empty homebrew-mumei repo in update-homebrew job

Summary

Fixes the update-homebrew job failing with fatal: couldn't find remote ref refs/heads/main when the mumei-lang/homebrew-mumei repository is empty (has no branches).

Root cause: The actions/checkout@v4 action assumes the target repo has a default branch. The homebrew-mumei repo was empty, so fetching refs/heads/main failed repeatedly.

What changed:

  1. Checkout step: Replaced actions/checkout@v4 with a manual git clone that falls back to git init -b main + git remote add when the repo is empty.
  2. Push step: Replaced peter-evans/create-pull-request@v6 with a manual git commit + git push origin HEAD:main. This pushes the formula directly to main instead of creating a PR, which is simpler for automated formula updates and works correctly for both empty and existing repos.

Updates since last revision

  • Commit 4 (9701ceb): Handle empty homebrew-mumei repo — replaces actions/checkout + peter-evans/create-pull-request with manual git commands that gracefully handle repos with no branches.

Previous commits (already merged into develop via earlier PRs):

  • Commit 1 (055ce06): macos-13macos-15-intel for x86_64-apple-darwin
  • Commit 2 (f48ed6d): RUSTFLAGS Z3 linker path for musl (superseded by commit 3)
  • Commit 3 (2bc4885): Removed musl target entirely

Review & Testing Checklist for Human

  • Verify HOMEBREW_TAP_TOKEN secret has push access to mumei-lang/homebrew-mumei. The workflow now pushes directly to main instead of creating a PR, so the token needs write/push permissions (not just PR creation).
  • Check that 2>/dev/null on git clone won't mask auth errors. If HOMEBREW_TAP_TOKEN is invalid or expired, the clone will silently fail and fall back to git 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.
  • Behavioral change: direct push vs PR. Previously the workflow created a PR on homebrew-mumei via peter-evans/create-pull-request. Now it pushes directly to main. Confirm this is acceptable for your workflow — there will be no review step for formula updates.
  • Tag a new release (e.g. v0.2.11) after merging to trigger the release workflow and verify the update-homebrew job succeeds. This cannot be tested locally.

Test Plan

  1. Merge this PR into develop, then merge develop into main
  2. Push a new version tag (e.g. v0.2.11)
  3. Verify all 4 build targets pass (these should be unaffected)
  4. Verify the update-homebrew job completes successfully
  5. Check that mumei-lang/homebrew-mumei has a main branch with the generated formula

Notes


Open with Devin

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>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@AkiraTamai AkiraTamai marked this pull request as ready for review March 6, 2026 16:39
@AkiraTamai AkiraTamai merged commit 067d5bc into develop Mar 6, 2026
1 check was pending
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot changed the title fix: use macos-15-intel runner for x86_64-apple-darwin build fix: add Z3 static lib search path to RUSTFLAGS for musl build Mar 6, 2026
@devin-ai-integration devin-ai-integration Bot changed the title fix: add Z3 static lib search path to RUSTFLAGS for musl build fix: remove x86_64-unknown-linux-musl target from release matrix Mar 6, 2026
@devin-ai-integration devin-ai-integration Bot changed the title fix: remove x86_64-unknown-linux-musl target from release matrix fix: handle empty homebrew-mumei repo in update-homebrew job Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant