github/super-linter "fatal: ref does not exist" (default branch not fetched)
By Daniel Zoghalchali·Latchkey
super-linter diffs changed files against the default branch. A shallow checkout (fetch-depth: 1) leaves the base ref absent, so the diff command fails.
What this error means
super-linter errors with "fatal: ambiguous argument" or "ref does not exist" when computing changed files.
github-actions
fatal: ambiguous argument 'main...HEAD': unknown revision or path not in the working tree
##[error]Linter exited with error
Common causes
Shallow checkout
Default fetch-depth: 1 does not bring the default branch commit needed for the diff.
DEFAULT_BRANCH misconfigured
The configured default branch name does not match the repo, so the ref is absent.
How to fix it
Checkout with full history
Set fetch-depth: 0 on actions/checkout so the base branch is available.
Set DEFAULT_BRANCH to the repo default if it differs from main.