Skip to content

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

Merged
marcleblanc2 merged 6 commits into
mainfrom
ci/preview-links-for-changed-pages
Sep 11, 2026
Merged

ci/dev: Add direct links to changed pages in Vercel previews#1874
marcleblanc2 merged 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

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 11, 2026 1:11am UTC

Request Review

@marcleblanc2
marcleblanc2 marked this pull request as ready for review September 8, 2026 01:38
@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
marcleblanc2 requested a review from a team September 10, 2026 00:40

@pjlast pjlast left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is just really nice. Thanks!

@marcleblanc2
marcleblanc2 enabled auto-merge (squash) September 11, 2026 01:02
@marcleblanc2
marcleblanc2 force-pushed the ci/preview-links-for-changed-pages branch from d407d17 to 26b483c Compare September 11, 2026 01:02
marcleblanc2 added a commit that referenced this pull request Sep 11, 2026
Fixes `Foe example` → `For example` on the Kubernetes troubleshooting
page.

Also serves as the live test target for #1874: that workflow was
dispatched by hand against this PR's preview deployment, and the
"Preview links for changed pages" comment below is its output.

## Amp threads

- [Address PR 1874
feedback](https://ampcode.com/threads/T-01a08573-3d6c-7491-ac34-61b4800612a8)

Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) September 11, 2026 01:09
marcleblanc2 and others added 6 commits September 10, 2026 19:09
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>
…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>
@marcleblanc2
marcleblanc2 force-pushed the ci/preview-links-for-changed-pages branch from 26b483c to c83a341 Compare September 11, 2026 01:09
@marcleblanc2
marcleblanc2 merged commit 8df616f into main Sep 11, 2026
2 checks passed
@marcleblanc2
marcleblanc2 deleted the ci/preview-links-for-changed-pages branch September 11, 2026 01:11
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.

2 participants