Fix pre-release badges to actually track pre-releases#145
Merged
Conversation
Both `shields.io/github/v/release/...?include_prereleases` and `shields.io/nuget/vpre/...` use "include pre-releases as candidates, return latest by date/version" semantics — not "show pre-releases only". After every develop → main release merge a full release is published with a higher Nerdbank.GitVersioning height than the preceding pre-releases, so both pre-release badges converged to the same value as their release-only siblings within seconds. Observed today after #144 landed: the GitHub Pre-Release badge showed `v1.2.42` (a full release) while the actual latest pre-release was `1.2.40-g0f69a1b0a0`. Two changes: - Add `&filter=*-g*` to the GitHub pre-release shield URL. The `filter` glob is supported on `github/v/release` and matches the Nerdbank `-g<short-sha>` suffix that only pre-release tags carry; stable tags (`1.2.42`) don't. Verified live: the filtered URL renders `v1.2.40-g0f69a1b0a0` correctly. - Drop the NuGet pre-release badge entirely. The NuGet shield endpoint accepts only the path-level `v`/`vpre` variant and ignores `filter`; the `dynamic/json` escape hatch doesn't support JSONPath filter predicates (`query not supported`), and NuGet's flat-container index is semver-sorted so `[-1]` lands on the same stable. No clean shields.io fix exists, and the data is structurally redundant with the NuGet Release badge whenever a higher stable exists. The GitHub Pre-Release badge now carries the pre-release signal on its own. The upstream template carries the same badge pattern and is tracked separately for replication.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the README badges so the “GitHub Pre-Release” badge reflects develop-side Nerdbank.GitVersioning pre-release tags (with -g<short-sha> suffix) rather than drifting to the latest stable release.
Changes:
- Updated the GitHub pre-release shields.io URL to include
filter=*-g*(while still including prereleases). - Removed the NuGet pre-release badge and its link reference definition since shields.io can’t reliably filter NuGet prereleases.
3 tasks
ptr727
added a commit
that referenced
this pull request
May 13, 2026
Release: pre-release badges actually track pre-releases (#145)
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
&filter=*-g*to theprereleaseversion-shieldURL in README.md so the GitHub Pre-Release badge filters to tags with the Nerdbank-g<short-sha>suffix only.Why
Observed after #144 merged: the GitHub Pre-Release badge displayed
v1.2.42(a full release), even though the actual latest pre-release at the time was1.2.40-g0f69a1b0a0. Same for the NuGet Pre-Release badge.Root cause is shields.io semantics:
github/v/release/...?include_prereleasesandnuget/vpre/...both mean "include pre-releases as candidates and return the latest by published date / highest version" — not "show pre-releases only".For GitHub there's a clean fix: shields.io's
github/v/releaseendpoint accepts afilterglob. The Nerdbank short-sha suffix-g<10hex>only appears on pre-release tags, sofilter=*-g*cleanly selects pre-releases.For NuGet there isn't:
filtersilently.dynamic/jsonshield rejects JSONPath filter predicates (query not supported).$.versions[-1]lands on the same stable.No way to filter to pre-releases only without a custom hosted endpoint. Dropping it is cleaner than carrying a redundant badge — the GitHub Pre-Release badge now carries the develop-side signal on its own.
Verification
Hit the new shield URLs directly:
filter=*-g*→v1.2.40-g0f69a1b0a0✓v1.2.42✓Upstream
The upstream
ptr727/ProjectTemplateREADME likely carries the same badge pattern and the same bug. A separate issue will be filed there with details for replication.Test plan
Check pull request workflow statusgreen.