Repository navigation
fix: pin changelog relative links in release PR, commit and release bodies - #458
Merged
Merged
Conversation
…R bodies GitHub resolves a release body against the repo root and a PR body against the PR URL, so relative links in a per-version changelog 404 there. A shared pinRelativeLinks helper now resolves each relative link and image against the changelog's own folder and pins it to blob/vX.Y.Z (raw/ for images). It skips absolute URLs, anchors, mailto and other schemes, fenced and inline code, and paths above the repo root. Used by generate-comprehensive-changelog (release PR body, which becomes the squash commit), create-release and sync-release-notes. Sync points links at the default branch for files that don't exist at the tag (backfills). Resolves #457
The open release PR body now pins changelog links to its head branch (next/hotfixes) so they work during review; a tag link is dead until the release exists. Everything permanent gets tag links: - release-merge moves the head-branch links to vX.Y.Z in the squash commit message (repinBranchLinks), so master's release commit carries tag links. - The tag message and GitHub Release body use the tag, as before. - sync-release-notes points each merged release PR's links at its tag once the tag exists (and pins old, still-relative bodies), leaving bodies that already have them alone. Its App token now requests pull_requests. The generator takes the ref as changelog-link-ref (default: the tag); create-release-pr and update-release-pr pass the head branch. Resolves #457
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 14, 2026
# v4.36.1 — 2026-11-13 Patch release that fixes relative links in changelog files once they become a release PR body, a release commit, a tag message or a GitHub Release. GitHub resolves a PR body against the PR URL and a release body against the repo root, so a link like `../../drivers.md` that works in the file view 404'd on every release page. The changelog files stay relative; the links are rewritten where the file turns into a body. ## Bug Fixes - **Changelog links pinned per surface.** A shared `pinRelativeLinks` helper in `release-notes.mjs` resolves each relative link and image against the changelog's own folder and turns it into an absolute `https://github.com/<repo>/blob/<ref>/…` URL (`raw/` for images). It leaves absolute URLs, `//host` links, `#anchors`, `mailto:` and other schemes, fenced and inline code, and paths above the repo root alone. The ref depends on where the text ends up. Resolves [#457](#457). ([#458](#458)) - **Open release PR body:** the PR's head branch (`next`, or `hotfixes` on the hotfix lane), so the links work during review. generate-comprehensive-changelog takes it as the new `changelog-link-ref` input, which create-release-pr and update-release-pr set to the head branch. It defaults to the release tag. - **Release commit:** release-merge moves the head-branch links to `vX.Y.Z` before the squash merge, so the commit on `master` carries tag links. - **Tag message and GitHub Release:** the release tag, in create-release and sync-release-notes. - **Merged release PR:** once the tag exists, sync-release-notes finds each release's PR from its release commit and points its links at the tag. It also pins bodies from before this release that still have relative links, and leaves bodies that already carry tag links alone. Its App token now requests `pull_requests`. - **Backfilled changelogs:** sync-release-notes reads a changelog from the default branch, so it can link to something added after the release. Those links point at the default branch instead of a 404 at the tag. ## Upgrade notes - No caller changes needed, and changelog files keep their relative links. - Releases published before this one still show broken links until they are re-synced. Dispatch `sync-release-notes.yml` in each affected repo (dry run first, then a real run) to rewrite the old release pages and release PR bodies. <details> <summary>👥 Contributors</summary> - @Shinrai </details> <!-- co-authors --> Co-authored-by: Shinrai <[email protected]>
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.
Relative links in a changelog file break once it becomes a PR or release body: GitHub resolves a PR body against the PR URL and a release body against the repo root. The files stay relative. The links get rewritten where the file turns into a body.
pinRelativeLinks(release-notes.mjs) resolves each relative link and image against the changelog's folder and pins it to a ref (blob/<ref>/…,raw/for images). It skips absolute URLs,//host, anchors,mailto:and other schemes, fenced and inline code, and paths above the repo root.next, orhotfixeson the hotfix lane) so the links work during review. The generator takes it aschangelog-link-ref; create-release-pr and update-release-pr pass the head branch, and the default is the tag.repinBranchLinksbefore the merge, so master's release commit carriesblob/vX.Y.Z/…links.pull_requests.No head-SHA links anywhere. After this ships, a sync-release-notes run in each affected repo fixes the old release pages and release PRs.
Resolves #457