#4349·lerna

`lerna publish` leaves repo in unrecoverable partial state after mid-air push conflict (tags pushed, release/publish not completed)

Author: mykola-mokhnachCreated May 6, 2026Updated May 6, 2026
Labelstype: bug

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:

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:

  1. Publish aborts before pushing tags, or
  2. Publish supports safe/idempotent retry if tags were already pushed, or
  3. 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:

  1. Configure a monorepo release workflow that runs lerna publish on a shared branch.
  2. Start a release job.
  3. While lerna publish is in progress, push additional commits to the same branch (or otherwise move branch state remotely).
  4. Observe that the initial release run fails after partially progressing.
  5. Re-run the release job.
  6. 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:

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

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"
}