auto icon indicating copy to clipboard operation
auto copied to clipboard

`TypeError: Invalid Version` in canary release command

Open yannbf opened this issue 4 years ago • 1 comments

Hey peeps, thanks a lot for this lib. It's super awesome!

Describe the bug

When running canary and the commit message starts with only numbers, it fails.

yarn release
yarn run v1.22.10
$ yarn build && auto shipit --dry-run
$ tsdx build
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
@rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.
✓ Creating entry file 4.9 secs
✓ Building modules 5.5 secs
TypeError: Invalid Version: 0.0.19--canary.0758324.0
    at new SemVer (/Users/yannbraga/Dev/open-source/testing-react/node_modules/@auto-it/core/node_modules/semver/classes/semver.js:38:13)
    at compare (/Users/yannbraga/Dev/open-source/testing-react/node_modules/@auto-it/core/node_modules/semver/functions/compare.js:3:3)
    at Object.lte (/Users/yannbraga/Dev/open-source/testing-react/node_modules/@auto-it/core/node_modules/semver/functions/lte.js:2:30)
    at Object.determineNextVersion (/Users/yannbraga/Dev/open-source/testing-react/node_modules/@auto-it/core/src/auto.ts:342:19)
    at /Users/yannbraga/Dev/open-source/testing-react/node_modules/@auto-it/npm/src/index.ts:1140:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I had this issue in my PR, and the way to fix it was to change my commit metadata so that the hash changed to something that included numbers and letters, and once it became 24ee251b40a3a, it all worked out correctly.

To Reproduce

You need to have a commit message that starts with only numbers, like 075832432fed12c, then execute auto shipit in canary mode (local/PR)

Expected behavior

The canary release should be done as expected

Screenshots

Environment information:

Environment Information:

"auto" version: v10.29.3
"git"  version: v2.31.1
"node" version: v12.18.3

yannbf avatar Jul 11 '21 23:07 yannbf

Interesting! There must be a regex somewhere that's misbehaving. If you could make a PR I would really appreciate it!

hipstersmoothie avatar Aug 12 '21 23:08 hipstersmoothie