From 67da988ce1037e55fe8e80793ffcbd982093b24a Mon Sep 17 00:00:00 2001 From: Caio Pizzol Date: Wed, 29 Apr 2026 07:51:05 -0300 Subject: [PATCH] ci(docs): trigger preview workflow on docs PRs to main Doc authors who PR against main currently get no hosted preview because Mintlify's automatic previews only fire on PRs targeting the deployment branch (docs-stable) and our preview workflow only fired on PRs targeting stable. They'd only see a preview when their work reached the promote-stable PR, days later. Add main as a trigger branch so doc-touching PRs to main get an instant preview URL. Path filter on apps/docs, document-api contract, and the generator script keeps the 5 req/min Mintlify API quota from being spent on unrelated code PRs. The path filter also applies to stable PRs but that's fine: promote-stable PRs always include docs, and code-only stable hotfixes don't need a docs preview. --- .github/workflows/preview-stable-docs.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview-stable-docs.yml b/.github/workflows/preview-stable-docs.yml index f52f8041b6..a5d11dffd8 100644 --- a/.github/workflows/preview-stable-docs.yml +++ b/.github/workflows/preview-stable-docs.yml @@ -1,13 +1,22 @@ -# Triggers a Mintlify preview deployment for any PR targeting `stable`. -# Promote-stable PRs target this branch, so reviewers see the docs that will -# go live the moment the release succeeds. -name: 👀 Preview docs for stable PRs +# Triggers a Mintlify preview deployment for docs-touching PRs targeting +# `main` or `stable`. The `stable` case covers promote-stable PRs so reviewers +# see the docs that will go live the moment the release succeeds. The `main` +# case gives doc authors a hosted preview during normal development, since +# Mintlify's automatic previews only fire on PRs targeting the deployment +# branch (`docs-stable`). Path filter keeps the 5 req/min Mintlify API quota +# from being spent on unrelated code PRs. +name: 👀 Preview docs for main and stable PRs on: pull_request: types: [opened, reopened, synchronize] branches: + - main - stable + paths: + - 'apps/docs/**' + - 'packages/document-api/src/contract/**' + - 'scripts/generate-all.mjs' permissions: pull-requests: write