[BUG] Moon CI resolves nonexistent master branch
Platform
GitHub Actions (ubuntu-latest, windows-latest, macos-latest) and Windows 11 locally with Moon 2.3.3.
Current Behavior
Every Bun CI run on main fails before a project task starts. The latest run, https://github.com/OpenCut-app/OpenCut/actions/runs/29121395671, fails in moon ci with:
fatal: ambiguous argument 'master': unknown revision or path not in the working tree.
.moon/workspace.yml does not define vcs.defaultBranch, so Moon 2.3.3 falls back to master, but this repository's default branch is main.
Expected Behavior
moon ci should compare against main and proceed to the affected task graph.
Steps To Reproduce
- Clone the repository at
bab8af831b354a0b5a98a4a6e818ab7d633b94df. - Run
bunx --bun @moonrepo/[email protected] cifrom the repository root. - Observe the failure resolving
master.
Proposed Fix
Add the following to .moon/workspace.yml:
vcs:
defaultBranch: 'main'
This is limited to Moon's affected-change base resolution. It does not alter application runtime behavior, GitHub's default branch, or task definitions.
I reproduced the current failure locally. With the explicit main base, Moon resolves the task graph without the master error. The current contribution policy asks for maintainer approval before a bug-fix PR, so requesting approval for this one-line CI correction.
Hi! I've been looking into this and can confirm the root cause.
Moon 2.3.3 falls back to master when vcs.defaultBranch is not set, but this repo's default branch is main - causing every CI run to fail with fatal: ambiguous argument 'master'.
Fix: Add the following to .moon/workspace.yml:
vcs:
defaultBranch: 'main'
I've implemented this fix on my fork (jigglu/OpenCut @ fix/easy-contributions) and it resolves the issue. Happy to contribute if the team opens up contributions for this.
Confirmed the diagnosis and root cause above — thanks @jigglu for tracking it down. This is still failing on every Bun CI run on main as of the latest run (2026-08-01): https://github.com/OpenCut-app/OpenCut/actions/runs/30718623077, with the same fatal: ambiguous argument 'master' error.
I've prepared the one-line fix (adding vcs.defaultBranch: 'main' to .moon/workspace.yml) on a branch here: https://github.com/wakqasahmed/OpenCut/tree/fix/moon-ci-default-branch-837 (commit f8c8e768).
I wasn't able to open a pull request against this repository — it looks like pull request creation is currently restricted to collaborators only (pull_request_creation_policy: collaborators_only), so external forks can't submit PRs at the moment. Happy to open one if that's adjusted, or a maintainer/collaborator is welcome to cherry-pick the branch directly.
I've created a branch with this fix on my fork:
- Branch:
fix/moon-ci-default-branch-main - Commit:
bc311f6
Added vcs.defaultBranch: 'main' to .moon/workspace.yml so that moon ci properly resolves the base branch against main instead of falling back to master.
Patched — ready to apply
I took this one because the fix is small and self-contained. To be clear up front: I was not able to open a PR. GitHub returns rollroyces does not have the correct permissions to execute CreatePullRequest (and POST /repos/.../pulls returns 404), so PR creation looks gated to collaborators. I know from the README and #811 that outside contributions aren't open during the architecture phase, so I'm not forcing it.
If you want it, here's the one-line change:
# .moon/workspace.yml
projects:
globs:
- 'apps/*'
- 'crates/*'
sources:
root: '.'
+vcs:
+ defaultBranch: 'main'
Branch with just that commit: https://github.com/rollroyces/OpenCut/tree/ci/moon-default-branch
Or open the PR directly — this link creates it with the branch pre-filled: https://github.com/OpenCut-app/OpenCut/compare/main...rollroyces:OpenCut:ci/moon-default-branch?expand=1
Scope
I deliberately kept this to the master-resolution failure and left the rest of #909 out:
runInCI: falseon the twodeploytasks — that's a decision about what should run in CI, not a broken config, and it's a one-liner on top of this.--passWithNoTestsforweb:test—bun testisvitest run, and with zero test files in the repo it exits 1. I confirmed there are currently no*.test.*/*.spec.*files anywhere, so CI will fail on this even after the branch fix lands.- The extra Ubuntu packages for
desktop:check, therust-cacheaddition,fail-fast,paths-ignore, and pinning actions to SHAs.
Happy to split any of those out if useful — but they're opinionated enough that they seem like they should be your call rather than arriving as part of a bugfix.
One caveat on #909's third item worth noting: apps/desktop/README.md already lists the eight Debian/Ubuntu packages desktop:check needs, so that's a known gap rather than an unknown one.