Files
vercel__workflow/.github/workflows/dispatch-front-workflow-release-pr.yml
Nathan Rajlich 3c50f8c77b ci: extract wait-for-vercel-project to vercel/wait-for-deployment-action (#2065)
* ci: extract wait-for-vercel-project to vercel/wait-for-deployment-action

The action's logic was duplicated between this repo and
vercel/workflow-server, which is annoying to keep in sync. Move it to
a standalone repository so both can consume the same pinned build.

Changes:

- Delete .github/actions/wait-for-vercel-project entirely.
- Replace all five `uses: ./.github/actions/wait-for-vercel-project`
  references with `uses: vercel/wait-for-deployment-action@<sha>` in:
    benchmarks.yml, dispatch-front-workflow-release-pr.yml,
    docs-checks.yml, tarballs-checks.yml, tests.yml
- All `with:` inputs (project-slug, environment, timeout,
  check-interval, github-token) are unchanged — the new action's
  input contract is backwards-compatible.

The new action is ESM-only, targets Node 24, ships a ~12KB bundle
(down from ~830KB in the old in-repo version) by dropping
@actions/core and its transitive undici dependency, and is
unit-tested. See https://github.com/vercel/wait-for-deployment-action.

* ci: bump wait-for-deployment-action to fix/status-context-auto for verification

Repinning to vercel/wait-for-deployment-action#fix/status-context-auto
(SHA 04d46ef) which fixes the broken 'opt-out' heuristic that made
status-context resolution silently disabled for every consumer.

Reproduced in this repo's E2E logs:

  Looking for GitHub deployment in environment "Preview – example-workflow"
  Deployment ID resolution disabled (status-context is empty)
  Deployment ready: https://example-workflow-...labs.vercel.dev
  Run E2E Tests: VERCEL_DEPLOYMENT_ID=         <-- empty

Will repin to the post-merge main SHA once CI is green.

* ci: bump wait-for-deployment-action pin to merged main SHA

Repinning from the fix/status-context-auto branch (04d46ef) to the
post-merge main SHA (0e2b0c5, vercel/wait-for-deployment-action#4).
The deployment-id resolution fix verified against the prior fix-branch
pin (E2E tests now read VERCEL_DEPLOYMENT_ID=dpl_... correctly across
the matrix; only flaky/unrelated Vercel deployment failures remain).

* ci: grant statuses:read alongside deployments:read

The wait-for-deployment-action also reads the 'Vercel – <slug>'
combined commit status to resolve the dpl_xxx ID. The official
permissions table lists statuses:read for
GET /repos/{owner}/{repo}/commits/{ref}/status.
2026-05-21 17:28:13 -07:00

114 lines
4.2 KiB
YAML

name: Dispatch Front Workflow Release PR
# DISABLED: This workflow dispatches to vercel/front (cross-repo) which
# requires a GitHub App token. The Release App has been temporarily
# removed, so this workflow is disabled (all jobs gated on `if: false`)
# until the App is restored. See .github/workflows/release.yml and
# .github/workflows/backport.yml, which have also been updated to no
# longer rely on the Release App.
on:
pull_request:
types: [opened, synchronize, reopened, closed]
concurrency:
group: dispatch-front-workflow-release-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
dispatch-front-sync:
name: Dispatch Front Sync
if: >
false &&
startsWith(github.event.pull_request.head.ref, 'changeset-release/') &&
github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: vercel
repositories: workflow,front
- name: Checkout workflow repo
uses: actions/checkout@v4
- name: Read workflow version
id: version
run: |
VERSION=$(node -e "const fs=require('fs'); const p=JSON.parse(fs.readFileSync('packages/workflow/package.json','utf8')); process.stdout.write(p.version)")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Wait for docs deployment
id: waitForDocsDeployment
uses: vercel/wait-for-deployment-action@0e2b0c5c5cce31f1648108aeec56467187aca037
with:
project-slug: workflow-docs
# The job-level `permissions: contents: read` blocks the default
# GITHUB_TOKEN from reading the Deployments / Statuses APIs.
# Use the GitHub App token, which already has the necessary scopes
# for the workflow,front repositories.
github-token: ${{ steps.app-token.outputs.token }}
timeout: 1200
check-interval: 15
environment: preview
- name: Dispatch front workflow (sync)
uses: actions/github-script@v7
env:
MODE: sync
FRONT_REPO: vercel/front
FRONT_WORKFLOW_ID: workflow-sync-workflow-release-pr.yml
SOURCE_REPO: ${{ github.repository }}
SOURCE_PR_NUMBER: ${{ github.event.pull_request.number }}
SOURCE_PR_URL: ${{ github.event.pull_request.html_url }}
WORKFLOW_VERSION: ${{ steps.version.outputs.version }}
DOCS_DEPLOYMENT_URL: ${{ steps.waitForDocsDeployment.outputs.deployment-url }}
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const trigger = require('./scripts/trigger-front-release-workflow-dispatch.cjs');
await trigger({ github, context });
dispatch-front-close:
name: Dispatch Front Close
if: >
false &&
startsWith(github.event.pull_request.head.ref, 'changeset-release/') &&
github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: vercel
repositories: workflow,front
- name: Checkout workflow repo
uses: actions/checkout@v4
- name: Dispatch front workflow (close)
uses: actions/github-script@v7
env:
MODE: close
FRONT_REPO: vercel/front
FRONT_WORKFLOW_ID: workflow-sync-workflow-release-pr.yml
SOURCE_REPO: ${{ github.repository }}
SOURCE_PR_NUMBER: ${{ github.event.pull_request.number }}
SOURCE_PR_URL: ${{ github.event.pull_request.html_url }}
WORKFLOW_VERSION: ""
DOCS_DEPLOYMENT_URL: ""
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const trigger = require('./scripts/trigger-front-release-workflow-dispatch.cjs');
await trigger({ github, context });