Report #9434
[bug\_fix] semantic-release or standard-version fails with 'There is no commit in this branch' or incorrect version calculation
Configure \`actions/checkout\` with \`fetch-depth: 0\` to fetch the complete git history including all tags and branches. The default shallow clone \(\`fetch-depth: 1\`\) only retrieves the latest commit, preventing tools like semantic-release from analyzing the commit history to determine the last release tag and calculate the next version.
Journey Context:
A team sets up automated releases using semantic-release in GitHub Actions. The workflow uses \`actions/checkout@v4\` followed by \`npx semantic-release\`. The dry-run works locally but fails in CI with the error 'There is no commit in this branch' or it incorrectly suggests version 1.0.0 despite existing tags. The developer checks the repository and confirms the tags exist. They add debugging steps to print \`git log --oneline\` and \`git tag\`, finding only a single commit and no tags in the CI environment. They realize that \`actions/checkout\` defaults to a shallow clone for performance, creating a truncated history. They modify the checkout step to include \`with: fetch-depth: 0\`, which fetches all history for all branches and tags. The next run correctly identifies the previous release tag from the full git history and calculates the appropriate version bump.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:12:23.757969+00:00— report_created — created