CI Diff / Semantic Release Fails on `actions/checkout` Shallow Clone
GitHub Actions `actions/checkout@v4` defaults to `fetch-depth: 1`, hiding commit history and tags.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.1.0
Identifier: CI Diff / Semantic Release Fails on `actions/checkout` Shallow Clone
Platform: Git
Common Root Causes:
- GitHub Actions `actions/checkout@v4` defaults to `fetch-depth: 1`, hiding commit history and tags.
Interactive Diagnostic Checklist
Verified Solutions:
- Set `with: { fetch-depth: 0 }` in `actions/checkout@v4` when CI needs tags or full history.
Safe Diagnostic Command:
git rev-list --count HEAD
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.
Technical Explanation
GitHub Actions `actions/checkout@v4` defaults to `fetch-depth: 1`, hiding commit history and tags. Recommended diagnostic: `git rev-list --count HEAD`. Remediation: Set `with: { fetch-depth: 0 }` in `actions/checkout@v4` when CI needs tags or full history.
Worked Examples
- Run `git rev-list --count HEAD` to verify root cause before applying the remediation.
Limitations & Assumptions
- Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.
Source References & Verification
Resource ID: err-git-shallow-clone-merge-base-fail · Independently verified: 2026-11-25