-
Notifications
You must be signed in to change notification settings - Fork 2.3k
No GitHub release is created when using a 'tag-version-separator' other than '@' #3974
Copy link
Copy link
Closed
Labels
Description
Current Behavior
After the 8.1.0, the version command does not create a GitHub release when using a custom version seperator.
Expected Behavior
I would expect there to be a new GitHub release associated with the new git tag.
Steps to Reproduce
- Create a new commit for one of your packages.
git commit -m'fix(package1): lerna version seperator test'- Create a new version of your package
$ npx lerna version --tag-version-separator '-' --conventional-commits --create-release github --yes
lerna notice cli v8.1.0
lerna info versioning independent
lerna info Looking for changed packages since package1g@1.0.7
lerna info getChangelogConfig Successfully resolved preset "conventional-changelog-angular"
Changes:
- package1: 1.0.7 => 1.0.8
lerna info auto-confirmed
lerna info execute Creating releases...
lerna info git Pushing tags...
lerna success version finished
If I repeat this step but use the '@' seperator, everything works as expected and I can see there was a fetch call presumably to GitHub to create a GitHub release.
$ git commit -m'fix(package1): lerna version seperator
$ npx lerna version --tag-version-separator '@' --conventional-commits --create-release github --yes
lerna notice cli v8.1.0
lerna info versioning independent
lerna info Looking for changed packages since package1-1.0.8
lerna info getChangelogConfig Successfully resolved preset "conventional-changelog-angular"
Changes:
- package1: 1.0.8 => 1.0.9
lerna info auto-confirmed
lerna info execute Creating releases...
lerna info git Pushing tags...
(node:54189) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
lerna success version finished
I believe the issue with this line of code in the create-release.ts file. It has a conditional that's checking if the incoming tag matches a string which contains a hard coded @ character. From some basic testing, something like this seems to resolve the issue.
const tag = name === "fixed" ? tags[0] : tags.find((t) => t.startsWith(`${name}${separator}`));I'm happy to make PR if it is indeed that simple of a fix.
Failure Logs / Configuration
lerna.json
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent"
}lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->Environment
Reactions are currently unavailable