Skip to content

lerna version - "error: unable to sign the tag" #2554

@ernestostifano

Description

@ernestostifano

Lerna fails to sign tags when running lerna version.

Expected Behavior

Tags to be correctly signed as well as commits (commits are successfully signed).

Current Behavior

lerna ERR! Error: Command failed: git tag @scope/my-package@1.0.0-beta.1 -m @scope/my-package@1.0.0-beta.1
lerna ERR! error: gpg failed to sign the data
lerna ERR! error: unable to sign the tag

Please note that the same command (git tag ...) works fine and succesfully sign tags when manually ran.

Possible Solution

Some ideas...

  • Is lerna version running tasks in child processes? Does those processes have access to the GPG agent (GPG Suite in this case)?
  • Commit signing seems to be correctly working, that should be a good staring point.
  • What user information (name/email) is being used? (GPG key to be used is matched using that info).

Steps to Reproduce (for bugs)

  1. Correctly setup GPG and set commit.gpgSign and tag.gpgSign to true in global git config.
  2. Run lerna version on project.
  3. Follow steps. Process will fail when trying to sign tags.
lerna.json

{
    "packages": ["./packages/*"],
    "version": "independent",
    "useWorkspaces": true,
    "npmClient": "yarn"
}

Your Environment

Executable Version
lerna --version 3.20.2
npm --version 6.14.4
yarn --version 1.22.4
node --version 13.12.0
OS Version
NAME VERSION
macOS Catalina 10.15.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions