Files
vercel__workflow/.github/workflows/docs-checks.yml
Pranay Prakash 11dc036854 ci: stop deploying changeset-release/main, run its e2e against production (#3243)
* ci: stop deploying changeset-release/main, run its e2e against production

The changesets action force-pushes `changeset-release/main`, and it can
point at exactly main's HEAD SHA. Vercel keeps one commit status per
project per SHA, so when both a production deployment (from main) and a
preview deployment (from changeset-release/main) are built for the same
commit, whichever finishes last owns the status. On 2026-07-30 the
preview finished last, so `vercel/wait-for-deployment-action` — which
reads the deployment ID out of that status — handed production e2e runs
a preview deployment ID and forked runs across environments.

Disable git deployments for that branch in every Vercel project rooted
in this repo, and give the changeset PR's Vercel e2e lanes a deployment
to test that actually exists: main's production deployment for the PR's
base SHA, resolved by SHA so a mid-flight production build is waited out
rather than silently replaced by an older one.

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>

* ci: resolve changeset-release e2e deployments with the wait action, tokenless

Per review: with changeset-release/main no longer deployed, main SHAs
can never again be deployed to a second environment of these projects,
so the per-SHA commit status the action reads is unambiguous for
exactly this lane. Reuse vercel/wait-for-deployment-action with
environment: production and sha pinned to the PR base SHA instead of
the Vercel-API polling script, drop the script and its VERCEL_TOKEN
usage, and inherit the action's inactive/skipped-build handling.

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>

---------

Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
2026-07-31 10:09:36 -07:00

111 lines
3.8 KiB
YAML

name: Docs Checks
on:
push:
branches:
- main
tags:
- "!*"
pull_request:
concurrency:
# Unique group for this workflow and branch
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
docs-typecheck:
name: Docs Code Samples
runs-on: ubuntu-latest
timeout-minutes: 5
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "pnpm"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Type-check documentation code samples
run: pnpm test:docs
docs-preview-smoke:
name: Docs Preview Smoke Checks
runs-on: ubuntu-latest
# `changeset-release/*` PRs are not deployed (every project's vercel.json
# sets `git.deploymentEnabled` false for that branch, because the branch is
# force-pushed to main's HEAD SHA and a same-SHA preview deployment
# clobbers the per-SHA Vercel commit status), so there is no preview to
# smoke-test. Their docs content is identical to main's, which this job
# already checked against production on the push that produced the bump.
if: ${{ !startsWith(github.head_ref, 'changeset-release/') }}
timeout-minutes: 5
permissions:
id-token: write
contents: read
deployments: read
statuses: read
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "pnpm"
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Waiting for the Docs Vercel deployment
id: waitForDocsDeployment
uses: vercel/wait-for-deployment-action@0e2b0c5c5cce31f1648108aeec56467187aca037
with:
project-slug: workflow-docs
timeout: 1000
check-interval: 15
environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }}
- name: Verify OpenGraph images and sitemap
if: steps.waitForDocsDeployment.outputs.deployment-state == 'success'
run: pnpm --filter docs test:smoke
env:
DEPLOYMENT_URL: ${{ steps.waitForDocsDeployment.outputs.deployment-url }}
# Trusted-sources OIDC token is minted on demand by
# scripts/trusted-sources-headers.mjs via the runner's
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN env vars (auto-set when
# `permissions: id-token: write` is on the job).
# See: https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/trusted-sources
- name: Verify rendered docs links
if: steps.waitForDocsDeployment.outputs.deployment-state == 'success'
run: pnpm --filter docs lint:rendered-links
env:
DEPLOYMENT_URL: ${{ steps.waitForDocsDeployment.outputs.deployment-url }}
# Trusted-sources OIDC token is minted on demand by
# scripts/trusted-sources-headers.mjs via the runner's
# ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN env vars (auto-set when
# `permissions: id-token: write` is on the job).
# See: https://vercel.com/docs/deployment-protection/methods-to-bypass-deployment-protection/trusted-sources