Skip to content

ci/dev: Add direct links to changed pages in Vercel previews - #1874

Open
marcleblanc2 wants to merge 6 commits into
mainfrom
ci/preview-links-for-changed-pages
Open

ci/dev: Add direct links to changed pages in Vercel previews#1874
marcleblanc2 wants to merge 6 commits into
mainfrom
ci/preview-links-for-changed-pages

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Problem

  • Vercel bot's build preview comment on every docs PR links to the root (home page) of the preview deployment
  • When your PR changes only one page, you still have to click through the preview site to find it (search to be fixed in PR fix/site: Search results link to current instance #1875)
  • Vercel has no setting to link directly at your changed page

Solution

Decisions made, and can be changed

  • Link list length capped at 40 pages
  • Deleted files are excluded
  • Renamed files link to the new path
  • PRs that change no docs/ pages get no comment

Amp threads

Vercel's bot comment only links to the root of the preview deployment.
This workflow runs on Vercel's vercel.deployment.success repository_dispatch
event, finds the PR for the deployed commit, and posts (or updates) a comment
with direct links to each changed docs/*.mdx page on the preview URL.

Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6e-2b53-73cb-be1c-faaf2308d033
Co-authored-by: Amp <amp@ampcode.com>
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 9, 2026 10:46am UTC

Request Review

@marcleblanc2 marcleblanc2 changed the title ci: comment on PRs with preview links to changed docs pages ci: Comment on PRs with preview links to changed docs pages Sep 9, 2026
@marcleblanc2 marcleblanc2 changed the title ci: Comment on PRs with preview links to changed docs pages ci/dev: Comment on PRs with preview links to changed docs pages Sep 9, 2026
@marcleblanc2 marcleblanc2 changed the title ci/dev: Comment on PRs with preview links to changed docs pages ci/dev: Add direct links to changed pages in Vercel previews Sep 9, 2026
marcleblanc2 and others added 3 commits September 9, 2026 03:19
…ing before merge

GitHub only delivers repository_dispatch to the workflow file on the default
branch, so the workflow could not be exercised from this PR. workflow_dispatch
takes the same two payload fields (url, sha) as inputs so the same script can be
run against a real PR before merging, and re-run by hand later.

Amp-Thread-ID: https://ampcode.com/threads/T-01a08573-3d6c-7491-ac34-61b4800612a8
Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant