Skip to content

[BUG] npm version commits with incorrect author name and email #3048

@denis-sokolov

Description

@denis-sokolov

Current Behavior:

npm version creates a git commit that has faulty author and committer name and email, if I rely on GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL variables.

Expected Behavior:

npm version creates a git commit that follows the same rules as git does and respects GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL variables.

Steps To Reproduce:

  1. export GIT_AUTHOR_NAME=John
  2. npm version major
  3. git show

Expected: see John as the author name.
Actual: see whatever is set in your ~/.gitconfig.

Environment:

  • OS: macOS Big Sur 11.2.3
  • Node: 14.14.0
  • npm: 7.5.0

On same OS and Node, but with npm 6.14.9 this works correctly, so this issue seems to be a regression.

Possibly related issues, although they were about old npm versions: npm/npm#14708, npm/npm#17306, npm/npm#8277.

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions