`lerna publish` leaves repo in unrecoverable partial state after mid-air push conflict (tags pushed, release/publish not completed)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 36.1k
- Forks
- 2.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 50
Description
Current Behavior
In a CI release workflow using lerna publish for a monorepo, a mid-air push to the release branch can cause the publish step to fail in a partial state:
- git tags are created/pushed
- release notes and npm publish do not complete
A rerun of the same workflow then fails because the tags already exist remotely, so the release is stuck and not recoverable automatically.
Observed runs:
- Initial interrupted execution (details): https://github.com/appium/appium/actions/runs/25442667852/job/74637970946 (Lerna publish exits with code 1)
- Retry execution: https://github.com/appium/appium/actions/runs/25442948646/job/74639021208 (Lerna publish exits with code 128 due to existing tags)
Expected Behavior
lerna publish should not leave a non-recoverable partial state when the remote branch changes mid-run.
Expected outcomes would be one of:
- Publish aborts before pushing tags, or
- Publish supports safe/idempotent retry if tags were already pushed, or
- Publish provides an official resume/recovery mode for this scenario.
At minimum, rerunning after this failure should not require destructive manual cleanup of tags.
Steps to Reproduce
This is reproducible in CI with concurrent branch movement:
- Configure a monorepo release workflow that runs
lerna publishon a shared branch. - Start a release job.
- While
lerna publishis in progress, push additional commits to the same branch (or otherwise move branch state remotely). - Observe that the initial release run fails after partially progressing.
- Re-run the release job.
- Observe rerun failure due to already-existing tags created by the first run.
I have not yet prepared a minimal public repro repo/PR, but can do so if needed. The linked runs above demonstrate the failure mode in production CI.
This issue may not be prioritized if details are not provided to help us reproduce the issue.
Failure Logs / Configuration
Relevant failing jobs:
- https://github.com/appium/appium/actions/runs/25442667852/job/74637970946
- https://github.com/appium/appium/actions/runs/25442948646/job/74639021208
Current workaround:
- Manually delete all tags produced by the failed run
- Re-run publish
lerna.json
https://github.com/appium/appium/blob/master/lerna.json
{
"$schema": "https://json.schemastore.org/lerna",
"changelogPreset": "conventional-changelog-conventionalcommits",
"command": {
"add": {
"exact": true
},
"publish": {
"message": "chore: publish"
},
"run": {
"concurrency": 8
},
"version": {
"conventionalCommits": true,
"createRelease": "github",
"allowBranch": ["master", "appium3"],
"exact": true
}
},
"ignoreChanges": ["**/test/**", "**/*.md"],
"useNx": false,
"version": "independent"
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked failing CI jobs and lerna.json, then trace the lerna publish flow around branch movement, tag creation, and retry handling. Reproduce the concurrent-branch scenario if possible and define the recovery behavior that prevents existing tags from blocking a rerun, with coverage for the partial-publish case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github-actions, typescript
- Domain
- ci-cd, release
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100