I’ve recently run into an issue where my GitLab pipeline gets stuck after executing npx semantic release. This pipeline has been running smoothly until now, and I haven’t made any changes that would explain the failure.
Here’s what I observe in the logs:
$ npx semantic-release
[2:36:25 PM] [semantic-release] › ℹ Running semantic-release version 21.1.2
[2:36:26 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/gitlab"
...
[2:38:01 PM] [semantic-release] › ℹ Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[10:11:58 PM] [semantic-release] › ℹ Start step "prepare" of plugin "@semantic-release/git"
[10:12:02 PM] [semantic-release] [@semantic-release/git] › ℹ Found 2 file(s) to commit
[8:00:41 AM] [semantic-release] › ✘ Failed step "prepare" of plugin "@semantic-release/git"
I have found this error. This error comes with the environment git version(v1.323.0) conflicting with package.json(v1.324.0) and package-lock.json(v1.324.0). Therefore I deleted the current version tag v1.324.0 and recreated the version tag. I have used these commands locally.
git tag -d v1.324.0
git tag v1.324.0
git push origin v1.324.0
npx semantic-release --no-ci
git commit -am "chore(release): 1.324.0 [skip ci] --no-verify"
git push origin develop --tags