Skip to content

Preview docs on forked repo#428

Closed
jiwenc-nv wants to merge 2 commits intomainfrom
jiwenc/revert-docs-preview-split
Closed

Preview docs on forked repo#428
jiwenc-nv wants to merge 2 commits intomainfrom
jiwenc/revert-docs-preview-split

Conversation

@jiwenc-nv
Copy link
Copy Markdown
Collaborator

@jiwenc-nv jiwenc-nv commented Apr 29, 2026

Summary by CodeRabbit

  • Documentation

    • Enhanced contributor documentation with step-by-step validation instructions, guidance on resolving documentation build warnings, and comprehensive information about automated GitHub Pages preview URLs for pull requests.
  • Chores

    • Simplified and streamlined the documentation deployment pipeline by consolidating preview generation and GitHub Pages deployment directly into the primary build workflow, reducing operational complexity.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

This change consolidates the GitHub Actions documentation deployment from a two-workflow architecture into a single workflow. Previously, the main docs.yaml workflow would trigger docs-deploy-preview.yaml upon completion to handle PR preview deployments. The update merges this logic directly into docs.yaml, which now conditionally deploys to either the main GitHub Pages directory (for main branch) or to a PR-specific preview path (for pull requests). The related documentation is updated to explain the local build validation steps and the new automated preview mechanism for PRs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Preview docs on forked repo' is overly vague and does not clearly reflect the main changes, which involve consolidating the docs preview workflow into the main docs.yaml file and removing the separate deployment preview workflow. Consider a more specific title like 'Consolidate docs preview into main workflow' or 'Simplify docs deployment workflow' that better captures the core refactoring.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jiwenc/revert-docs-preview-split

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/docs.yaml (1)

154-195: ⚠️ Potential issue | 🟠 Major

Gate PR preview deploy to same-repo branches to prevent permission failures.

Line 154 currently allows all pull_request events, and Line 189-195 then tries to push to gh-pages. For forked PRs, GITHUB_TOKEN is read-only, so this path fails reliably.

Suggested fix
-    if: needs.check-repo.outputs.is-canonical-repo == 'true' && (needs.check-repo.outputs.is-deploy-branch == 'true' || github.event_name == 'pull_request')
+    if: needs.check-repo.outputs.is-canonical-repo == 'true' && (
+      needs.check-repo.outputs.is-deploy-branch == 'true' ||
+      (github.event_name == 'pull_request' &&
+       github.event.pull_request.head.repo.full_name == github.repository)
+    )

As per coding guidelines, .github/workflows/** reviews must focus on security and correctness of build/deploy steps.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs.yaml around lines 154 - 195, The PR preview deploy
must be limited to same-repo PRs to avoid readonly GITHUB_TOKEN for forked PRs;
update the condition on the "Deploy PR preview to gh-pages" step (currently
using if: github.event_name == 'pull_request') to also check that the PR head
repo equals the base repo (e.g. add &&
github.event.pull_request.head.repo.full_name == github.repository), and
similarly constrain the earlier top-level if that currently allows any
pull_request (the block starting with if:
needs.check-repo.outputs.is-canonical-repo == 'true' &&
(needs.check-repo.outputs.is-deploy-branch == 'true' || github.event_name ==
'pull_request')) so artifact/download and copy steps only run for same-repo PRs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/docs.yaml:
- Around line 180-195: Update the GitHub Action steps that use
peaceiris/actions-gh-pages to the v4 major release: change the two occurrences
of "uses: peaceiris/actions-gh-pages@v3" (the "Deploy to gh-pages (main branch)"
and "Deploy PR preview to gh-pages" steps) to "uses:
peaceiris/actions-gh-pages@v4" so the workflow runs on current runners with Node
20 compatibility.

---

Outside diff comments:
In @.github/workflows/docs.yaml:
- Around line 154-195: The PR preview deploy must be limited to same-repo PRs to
avoid readonly GITHUB_TOKEN for forked PRs; update the condition on the "Deploy
PR preview to gh-pages" step (currently using if: github.event_name ==
'pull_request') to also check that the PR head repo equals the base repo (e.g.
add && github.event.pull_request.head.repo.full_name == github.repository), and
similarly constrain the earlier top-level if that currently allows any
pull_request (the block starting with if:
needs.check-repo.outputs.is-canonical-repo == 'true' &&
(needs.check-repo.outputs.is-deploy-branch == 'true' || github.event_name ==
'pull_request')) so artifact/download and copy steps only run for same-repo PRs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 75a860a9-fea4-47b2-8ea7-9f0fe7791035

📥 Commits

Reviewing files that changed from the base of the PR and between 48011b6 and e5c886e.

📒 Files selected for processing (3)
  • .github/workflows/docs-deploy-preview.yaml
  • .github/workflows/docs.yaml
  • docs/source/getting_started/contributing.rst
💤 Files with no reviewable changes (1)
  • .github/workflows/docs-deploy-preview.yaml

Comment on lines +180 to +195
- name: Deploy to gh-pages (main branch)
if: github.event_name == 'push' && needs.check-repo.outputs.is-deploy-branch == 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
keep_files: true

- name: Deploy PR preview to gh-pages
if: github.event_name == 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/current
destination_dir: preview/pr-${{ github.event.pull_request.number }}
keep_files: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify affected references in this workflow
rg -n 'peaceiris/actions-gh-pages@v3|peaceiris/actions-gh-pages@v4' .github/workflows/docs.yaml

Repository: NVIDIA/IsaacTeleop

Length of output: 158


🌐 Web query:

peaceiris/actions-gh-pages v3 v4 compatibility GitHub runners deprecation

💡 Result:

peaceiris/actions-gh-pages v4.0.0 (released April 8, 2024) is fully compatible with current GitHub-hosted runners including ubuntu-latest, macos-latest, and windows-latest. It requires Node.js >=20.11.0, addressing the prior Node 16 deprecation. v3 (e.g., v3.9.3) uses Node >=16.19.0, which faced deprecation warnings after GitHub Actions transitioned from Node 16 to Node 20 (enforced June 2024). Users were recommended to upgrade to v4. As of 2026-04-29: - Node 20 (v4's requirement) reaches EOL on 2026-04-30 but remains supported on runners until June 2, 2026 (default switch to Node 24), with full removal later in 2026. - An open issue (#1143, March 2026) proposes bumping to Node 24, but v4.0.0 remains current release and functional. - No deprecation of the action itself; compatible with all listed runners (ubuntu-22.04/20.04/latest, macos-latest, windows-latest). - Recommendation: Use @v4 or @v4.0.0 for stability; pin to commit hash for maximum reliability.

Citations:


peaceiris/actions-gh-pages@v3 uses Node 16, which is no longer compatible with current GitHub runners.

Lines 182 and 190 use @v3, which requires Node >=16.19.0. GitHub deprecated Node 16 from runners (enforced June 2024). Deployment jobs will fail on current runners. Upgrade to @v4, which requires Node 20 and is the current stable release.

Suggested fix
-        uses: peaceiris/actions-gh-pages@v3
+        uses: peaceiris/actions-gh-pages@v4

(Apply to both lines 182 and 190)

🧰 Tools
🪛 actionlint (1.7.12)

[error] 182-182: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


[error] 190-190: the runner of "peaceiris/actions-gh-pages@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/docs.yaml around lines 180 - 195, Update the GitHub Action
steps that use peaceiris/actions-gh-pages to the v4 major release: change the
two occurrences of "uses: peaceiris/actions-gh-pages@v3" (the "Deploy to
gh-pages (main branch)" and "Deploy PR preview to gh-pages" steps) to "uses:
peaceiris/actions-gh-pages@v4" so the workflow runs on current runners with Node
20 compatibility.

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.

1 participant