-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Github tag not showing the correct value #2117
Comments
I think both of these things are fundamentally because the badge sorts tags as semantic versions rather than chronologically.
More generally, there's several strange things going on here..
There are probably a lot of users depending on the existing functionality (which assumes semver), but there are probably also some things we can do to make it clearer what is going on here or make things a bit more consistent. @RedSparr0w I'm conscious you did some work on this fairly recently to solve several other problems but I can't remember what they were. Do you have any thoughts on this one? |
#1628 was recently merged which worked on the latest version function.
I'm really not quite sure what the best way to handle this would be. if (!pre){
// remove pre-releases from array
versions = versions.filter(function(version) {
- return !(/\d+-\w+/).test(version);
+ return !(/\d+-?[a-z][\w.-]*$/).test(version);
});
} But this may just be a band-aid fix as it obviously wont cover all cases, but i think it should be able to handle most cases.
Good point, I hadn't realized that at the time. #1682 (comment)
Chronological order does seem to make the most sense, |
That was the PR I was looking for - cheers for the refresher on all this.
Looking through the other examples
Looking through the linked issues in PR #1628, some people do expect semver ordering and want pre-releases to be excluded etc so that is useful functionality. It seems like there are 2 competing use cases. We could usefully allow
and
If we retain semver as the default if no |
I've just merged #2157 . Once that's deployed you'll be able to use |
This is now live so for projects that don't use SemVer you can use
to just show the most recent tag (by date). |
I have noticed that this
https://img.shields.io/github/tag/osmc/osmc.svg?label=OSMC (Vero 4K)
have been the same for a long time and when i check the project
https://github.com/osmc/osmc/tags
it is now at tag2018.08-1
. It seems that it can't handle the-
. That is the only reason i can find out...I also found out that this is also showing the wrong tag, 3.51b:
https://img.shields.io/github/tag/airdcpp/airgit.svg?label=AirDC
The correct tag should be
3.51
If i use the release it seems to show 3.51:
https://img.shields.io/github/release/airdcpp/airgit.svg?label=AirDC
But not all projects use
Releases
, onlyTags
.The text was updated successfully, but these errors were encountered: