Skip to content

feat: preview mode CI integration via GitHub Action#1041

Merged
dslovinsky merged 4 commits intomainfrom
ds/preview-ci-action
Feb 20, 2026
Merged

feat: preview mode CI integration via GitHub Action#1041
dslovinsky merged 4 commits intomainfrom
ds/preview-ci-action

Conversation

@dslovinsky
Copy link
Collaborator

@dslovinsky dslovinsky commented Feb 19, 2026

Summary

  • Refactor generate-preview composite action to run the content indexer instead of Fern
  • Harden preview.ts default mode: throw on missing env vars, write preview URL to $GITHUB_OUTPUT, skip watchers when CI is set
  • Remove fern-check job (no longer needed)
  • Comment out link-check job (lychee can't crawl cookie-based draft mode previews)
  • Update PR comment branding from "Documentation Preview" to "Preview Mode" with stable HTML marker

Closes DX-2301

Test plan

  • Push branch and verify workflow YAML parses (no syntax errors in Actions tab)
  • Open test PR → verify "building" comment appears → updates to "Ready" with working preview link
  • Run pnpm preview locally — still indexes, uploads, prints URL, and starts watchers

Port the local `pnpm preview` logic to CI so every PR gets an automatic
preview link comment. Harden preview.ts to throw on missing env vars,
write to $GITHUB_OUTPUT, and skip watchers in CI. Remove the link-check
job (incompatible with cookie-based draft mode previews).

Co-Authored-By: Claude <noreply@anthropic.com>
@dslovinsky dslovinsky self-assigned this Feb 19, 2026
dslovinsky and others added 2 commits February 19, 2026 18:14
The CI checkout only has the remote ref, not a local main branch.

Co-Authored-By: Claude <noreply@anthropic.com>
- Move env var check before indexer run (fail fast)
- Refactor generate-preview into reusable composite action
- Remove fern-check job (no longer needed)
- Comment out link-check with TODO (draft mode incompatible with lychee)
- Update PR comment branding to "Preview Mode"

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 19, 2026

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Feb 19, 2026, 11:47 PM

@alchemyplatform alchemyplatform deleted a comment from github-actions bot Feb 19, 2026
@dslovinsky dslovinsky marked this pull request as ready for review February 19, 2026 23:37
@dslovinsky dslovinsky requested a review from a team as a code owner February 19, 2026 23:37
Copilot AI review requested due to automatic review settings February 19, 2026 23:37
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42611d3262

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the PR-checks GitHub Actions workflow to generate documentation previews using the repository’s content indexer preview mode, and posts/updates a PR comment with the resulting preview link.

Changes:

  • Update preview indexing script behavior for CI (required env vars, emit preview URL to $GITHUB_OUTPUT, skip watchers in CI).
  • Rework the generate-preview composite action to run npx tsx src/content-indexer/preview.ts and post “building”/result comments.
  • Adjust preview MDX uploader to diff against origin/main, and remove/disable link-checking tied to preview crawling.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/content-indexer/uploaders/preview-mdx.ts Switch diff base to origin/main for changed-file detection.
src/content-indexer/preview.ts Require preview env vars, emit preview URL to $GITHUB_OUTPUT, and exit early in CI.
scripts/preview-comment.js Update the PR comment title used for preview status/link comments.
.github/workflows/pr-checks.yml Simplify preview generation job and disable link-check job.
.github/actions/generate-preview/action.yml Replace Fern-based preview generation with content-indexer execution + PR comment posting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Rename output key from preview-url to preview_url (hyphens parsed as
  subtraction in GHA expressions)
- Pass github-token via with: instead of env: for actions/github-script
- Use hidden HTML marker for stable comment matching across title changes

Co-Authored-By: Claude <noreply@anthropic.com>
@dslovinsky
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eca64c7906

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Contributor

@vahnag vahnag left a comment

Choose a reason for hiding this comment

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

exciting

@dslovinsky dslovinsky merged commit 2f804cd into main Feb 20, 2026
7 checks passed
@dslovinsky dslovinsky deleted the ds/preview-ci-action branch February 20, 2026 00:34
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

Comments