Interview Prep/Git & GitHub/Repository Health, Size and Performance

In CI, `git describe --tags` fails with `fatal: No names found, cannot describe anything.`

IntermediateTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → The checkout is shallow (actions/checkout defaults to fetch-depth: 1) and has no tags, so there is nothing to describe from. It can also happen if the tags are lightweight and you omitted --tags.

Diagnose →

git rev-parse --is-shallow-repository
git tag --list | head

Fix → Fetch full history and tags:

- uses: actions/checkout@v4
  with:
    fetch-depth: 0       # full history + tags

Or on an existing clone: git fetch --unshallow --tags.

Prevent → Any job that computes versions from tags (semantic-release, git describe, changelogs) must use fetch-depth: 0.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance