fix: detect stable branch version from GITHUB_REF for display_version - #15157
Closed
skjnldsv wants to merge 1 commit into
Closed
fix: detect stable branch version from GITHUB_REF for display_version#15157skjnldsv wants to merge 1 commit into
skjnldsv wants to merge 1 commit into
Conversation
On stable branches, release = 'latest' for HTML builds since DOCS_RELEASE is only set for PDF/ePub. The previous formula str(version_stable + 1) would produce the wrong display version on stable branch HTML builds (e.g. "35" on stable34 docs instead of "34"). Detect the branch number from GITHUB_REF so each stable branch shows its own version in titles and the picker button. Falls back to str(version_stable + 1) on master where GITHUB_REF does not match the stable pattern, preserving existing master behavior. Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Contributor
📖 Documentation PreviewNo RST documentation pages changed in this PR. Last updated: Tue, 16 Jun 2026 07:32:25 GMT |
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.
Follow-up to #15140.
The previous
display_versionformula (str(version_stable + 1)) works correctly on master but breaks on stable branches: sincerelease = 'latest'for HTML builds (DOCS_RELEASE is only set for PDF/ePub), a stable34 HTML build would show "35" in titles instead of "34".This PR uses
GITHUB_REFto detect which stable branch we're building and returns the correct version number. Master behavior is unchanged (GITHUB_REF = refs/heads/master does not match the stable pattern, so it falls through tostr(version_stable + 1)).The same fix has already been applied to the three backport PRs (#15154, #15155, #15156).
✅ Checklist
codespellor similar and addressed any spelling issues