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

Jenkins Changelog Plugin: getHighestSemanticVersion() works only for master branch #127

Closed
sprnza opened this issue Mar 17, 2022 · 3 comments

Comments

@sprnza
Copy link

sprnza commented Mar 17, 2022

Hi! Thanks for the library and the plugin.
I try to get the highest Semantic Version in a custom branch but it seems like it's not possible to specify a branch to gather tags from and it always uses master branch. If there is no a master branch it fails with an error.

se.bjurr.gitchangelog.api.exceptions.GitChangelogRepositoryException: master not found in:

Would be great to have ability to use it like this

getHighestSemanticVersion to: [type: 'REF', value: 'HEAD']

In the command line there is an option for it and it works as expected:

npx git-changelog-command-line -phv -tc HEAD
0.0.2
@sprnza
Copy link
Author

sprnza commented Mar 17, 2022

Since getNextSemanticVersion does support specifying to this

def highestVersion = getHighestSemanticVersion()
def nextVersion = getNextSemanticVersion to: [type: 'REF', value: 'HEAD']
println(highestVersion.toString())
println(nextVersion.toString())

yelds to

[Pipeline] getHighestSemanticVersion 
[Pipeline] getNextSemanticVersion
[Pipeline] echo
0.0.1
[Pipeline] echo
0.0.5

@tomasbjerre
Copy link
Owner

I agree! I changed it so that it will look for head and if that does not exist look for master. Released the plugin as 3.23.

@sprnza
Copy link
Author

sprnza commented Mar 18, 2022

Thank you! Works perfectly!

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

No branches or pull requests

2 participants