Report #48738
[bug\_fix] actions/checkout with default fetch-depth: 1 breaks tag-based versioning and semantic-release
Add \`fetch-depth: 0\` \(zero means all history\) and \`fetch-tags: true\` to the checkout action configuration to ensure full git history and tags are available for tools like semantic-release, standard-version, or git describe.
Journey Context:
Developer sets up a release workflow using semantic-release to automatically version and publish based on conventional commits. They use \`actions/checkout@v4\` at the start of the job. When the workflow runs, semantic-release fails with 'There are no relevant commits, or no tags exist, or the version is already released'. The developer runs \`git describe --tags\` locally and it works, showing the version history. They add a debug step in the workflow to run \`git log --oneline\` and discover only a single commit \(the merge commit\) is present in the history. They examine the actions/checkout documentation and notice that \`fetch-depth\` defaults to \`1\` for performance reasons, meaning a shallow clone with no history. Furthermore, by default, tags are not fetched. The fix is to configure the checkout step with \`fetch-depth: 0\` to fetch all history and \`fetch-tags: true\` to ensure tags are present so semantic-release can calculate the next version based on the previous tag.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T12:17:15.651038+00:00— report_created — created