`lerna publish` leaves repo in unrecoverable partial state after mid-air push conflict (tags pushed, release/publish not completed)
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
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"
}Source: lerna/lerna