Skip to content

fix(github): Link cross-repo references in GitHub bodies - #2576

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/github-body-reference-links
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/github-body-reference-links

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Junior wrote getsentry/sentry-docs#20303 in the body of getsentry/sentry#129613. getsentry/sentry has a repository autolink with the prefix SENTRY-. That autolink took the sentry-docs part and made it a Sentry issue search link (query=SENTRY-docs). GitHub then linked the leftover #20303 to getsentry/sentry#20303, which is the wrong PR. Both references in that body broke this way. getsentry/sentry#129100 has the same problem.

Markdown link labels render correctly in that repo, for example [getsentry/sentry-cocoa#6515](…) in getsentry/sentry#127146. Slack replies already go through linkifyGitHubReferences, and it produces exactly that form. This change also runs it on model-written bodies in createPullRequest, updatePullRequest, createIssue, updateIssue, and submitPullRequestReview (the summary and inline comments). The function already skips code, existing links, URLs, and HTML comments, so a second pass over a body changes nothing.

Comments posted with gh from the sandbox don't go through these tools, so they still aren't covered.

via @mrduncan.

--

View Session [Sentry]

Bare owner/repo#N shorthand can be claimed by a repository autolink.
In getsentry/sentry, the SENTRY- prefix turned getsentry/sentry-docs#20303
into a Sentry issue search link plus a link to getsentry/sentry#20303.
Rewrite the shorthand to Markdown links in PR, issue, and review bodies;
GitHub leaves link labels alone.

Co-Authored-By: Matt Duncan <[email protected]>
@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 3, 2026 12:25am UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 3, 2026

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 32070c60 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant