Skip to content

fix: detect stable branch version from GITHUB_REF for display_version - #15157

Closed
skjnldsv wants to merge 1 commit into
masterfrom
fix/display-version-stable-branches
Closed

fix: detect stable branch version from GITHUB_REF for display_version#15157
skjnldsv wants to merge 1 commit into
masterfrom
fix/display-version-stable-branches

Conversation

@skjnldsv

Copy link
Copy Markdown
Member

Follow-up to #15140.

The previous display_version formula (str(version_stable + 1)) works correctly on master but breaks on stable branches: since release = '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_REF to 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 to str(version_stable + 1)).

The same fix has already been applied to the three backport PRs (#15154, #15155, #15156).

✅ Checklist

  • I have built the documentation locally and reviewed the output
  • Screenshots are included for visual changes
  • I have not moved or renamed pages (or added a redirect if I did)
  • I have run codespell or similar and addressed any spelling issues

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>
@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

🔍 Open preview →

No RST documentation pages changed in this PR.

Last updated: Tue, 16 Jun 2026 07:32:25 GMT

@skjnldsv skjnldsv closed this Jun 16, 2026
@skjnldsv
skjnldsv deleted the fix/display-version-stable-branches branch June 16, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant