ENOGITHEAD cicd release ai_generated true

ENOGITHEAD The git HEAD is detached. semantic-release requires the branch to be checked out.

ID: cicd/semantic-release-failed

Also available as: JSON · Markdown
85%Fix Rate
88%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

semantic-release failed due to git checkout being in detached HEAD state, missing GitHub token permissions, or commit message parsing issues. CI environments often check out specific commits rather than branches.

generic

Workarounds

  1. 90% success Configure the checkout action to fetch full history and branch
    In GitHub Actions, use: actions/checkout@v4 with: { fetch-depth: 0 }. This fetches full git history so semantic-release can analyze all commits and tags. Ensure the branch is checked out, not a detached commit.
  2. 88% success Ensure GITHUB_TOKEN has correct permissions
    Set permissions in the workflow: permissions: { contents: write, issues: write, pull-requests: write }. Or use a personal access token with repo scope stored as a secret, referenced as GH_TOKEN.

Dead Ends

Common approaches that don't work:

  1. Running semantic-release on pull request branches 80% fail

    semantic-release is designed for release branches (main, master, next). Running on PR branches creates releases from unmerged code and produces duplicate versions.

  2. Manually tagging commits instead of letting semantic-release manage tags 75% fail

    semantic-release determines the next version from git tags. Manual tags that do not follow its conventions cause it to calculate incorrect versions or skip releases.

Error Chain

Leads to:
Preceded by:
Frequently confused with: