Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Mintlify-flavoured MDX build (see `src/plugins/vite-mintlify-snippets.ts` and
| `DOCS_LOCALE` | A singular locale build (`en`, `es`, `pt-BR`, and so on); normally set only by the Vercel shard orchestrator. |
| `DOCS_LOCALES` | Translations included in a `translations` or legacy `combined` artifact: `none`, `all`, or a comma-separated list such as `es,fr`. The translations project uses `all`. |
| `DOCS_REMOTES` | Registered remote-source scope: `none` for an ordinary base-repository preview and `all` for source previews, production, and a base preview carrying `docs-preview-show-remotes`. |
| `DOCS_REMOTE_NAME`, `DOCS_REMOTE_REPOSITORY`, `DOCS_REMOTE_REF` | CI-only tuple selecting one registered remote at an immutable commit for an English pull-request preview. |
| `DOCS_REMOTE_NAME`, `DOCS_REMOTE_REPOSITORY`, `DOCS_REMOTE_REF` | CI-only tuple selecting one registered remote at an immutable commit for an English source pull-request preview. Required for that `connect-preview` mode; a trusted base preview with `docs-preview-show-remotes` instead uses `DOCS_REMOTES=all`. |
| `DOCS_REMOTE_SOURCE_REPOSITORY` | CI-derived PR-head repository, retained only for preview attribution and edit links. It defaults to the registered repository. |
| `DOCS_REMOTE_PULL_REQUEST_REF` | CI-only base-repository PR ref (`refs/pull/<number>/head`) to fetch and verify against `DOCS_REMOTE_REF`. |
| `DOCS_REMOTES_PREFETCHED=1` | Requires the remote mounts and fetch-state files supplied by the credentialed CI fetch job. |
Expand Down
10 changes: 10 additions & 0 deletions src/lib/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,16 @@ export function readScope(root = process.cwd()): BuildScope {
)
: parseRemotePreview(fileScope?.remotePreview, ".preview-scope.json remotePreview");

// connect-preview has two trusted modes: a source-PR preview with one
// immutable remote tuple, or a base-repository preview that explicitly
// requests every registered remote through its workflow-controlled scope.
const showAllRemotesPreview =
!hasRemoteEnvironment && envRemotes.toLowerCase() === "all";
if (vercelTarget === "connect-preview" && !remotePreview && !showAllRemotesPreview) {
throw new Error(
"Vercel connect-preview builds require DOCS_REMOTE_NAME, DOCS_REMOTE_REPOSITORY and DOCS_REMOTE_REF, or DOCS_REMOTES=all",
);
}
Comment thread
cursor[bot] marked this conversation as resolved.
if (remotePreview && (locale !== "en" || locales.length > 0)) {
throw new Error("Remote pull-request previews are English-only; omit DOCS_LOCALES");
}
Expand Down
Loading