Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No GitHub release is created when using a 'tag-version-separator' other than '@' #3974

Closed
briananstett opened this issue Mar 12, 2024 · 3 comments · Fixed by #3979
Closed

Comments

@briananstett
Copy link
Contributor

briananstett commented Mar 12, 2024

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

  1. Create a new commit for one of your packages.
git commit -m'fix(package1): lerna version seperator test'
  1. 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

@JamesHenry
Copy link
Member

Thanks a lot for the digging here @briananstett I think you're absolutely right! Would you like to submit the PR?

@briananstett
Copy link
Contributor Author

Sure thing @JamesHenry. I'm not a real programmer so hope the change is acceptable. PR made.
#3979

@briananstett
Copy link
Contributor Author

@JamesHenry I have a PR when you're ready to review. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants