Skip to content

Bug report: publish next build breaks when the commit hash has a leading zero and consists of only numbers #4194

@waldekmastykarz

Description

@waldekmastykarz

Description

The publish_next build breaks when the commit hash has a leading zero and consists of only numbers. The script responsible for extracting the commit hash and adding it to the package version, treats the hash as a number which leads to the leading 0 being removed. See example build at https://github.com/pnp/cli-microsoft365/actions/runs/3606017259/jobs/6079529925

Steps to reproduce

Very hard, because you need to have a short commit hash consisting of only numbers

Expected results

npm package published with the exact short commit hash

Actual results

npm package published the with the short commit hash with the leading 0 stripped

Diagnostics

No response

CLI for Microsoft 365 version

Latest from main

nodejs version

v16

Operating system (environment)

Linux

Shell

bash

cli doctor

No response

Additional Info

It seems like the issue is caused by the npm publish command that removes the leading 0 from the package version. It seems like we're stamping the correct version in the update-package-version.js script, but when we then move to npm publish, what's published is the version without the leading 0.

image

A workaround could be to check if the short commit hash starts with a 0 and if so, if it's a number, and if it is, add an additional letter.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions