Skip to content

[Bug?]: Trying to set a specific version with yarn version fails at timesΒ #6857

@vladfrangu

Description

@vladfrangu

Self-service

  • I'd be willing to implement a fix

Describe the bug

It seems the detection for specific versions in yarn version has some issues depending on the version used. We use yarn version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s) in our CI/CD pipeline for automatic alpha releases, and it seems that the fact the git commit hash is all numbers is causing issues.

To reproduce

package.json

{
  "name": "bump-issue",
  "version": "0.38.16",
  "packageManager": "[email protected]"
}

Run yarn version 0.38.17-next.0785436.1753219341.

Environment

System:
    OS: macOS 26.0
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 22.16.0 - /private/var/folders/p1/0bnmd1p94cbcd40t7y638bmc0000gn/T/xfs-e41760be/node
    Yarn: 4.9.1 - /private/var/folders/p1/0bnmd1p94cbcd40t7y638bmc0000gn/T/xfs-e41760be/yarn
    npm: 10.9.2 - ~/.volta/tools/image/node/22.16.0/bin/npm
    bun: 1.2.18 - ~/.bun/bin/bun

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions