Skip to content

Conversation

@wuyiping0628
Copy link
Collaborator

@wuyiping0628 wuyiping0628 commented Dec 30, 2025

Summary by CodeRabbit

  • Chores
    • Set up continuous integration workflows that automatically build and deploy documentation changes from the develop branch, improving documentation synchronization and delivery efficiency
  • Style
    • Corrected minor whitespace formatting in documentation files

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Walkthrough

Two new GitHub Actions workflows automate documentation building and deployment. The first triggers on PRs and pushes to develop affecting docs/, cloning the main docs repository, checking out the PR branch, setting up pnpm, and building documentation with status reporting. The second notifies the main docs repository via repository_dispatch when docs are updated. Minor whitespace formatting is also added to a documentation guide.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/auto-build-main-module-docs.yml, .github/workflows/auto-deploy-docs.yml
Two new workflows added: one automates building docs on PR/push to develop by cloning docs-main, checking out PR branch, installing dependencies via pnpm, and reporting build status; the other sends a webhook notification to the main docs repository when docs are updated
Documentation Formatting
docs/src/guide/plugin-badge.md
Minor whitespace: extra blank lines added inside code blocks before import statements for presentation formatting

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Workflows hop into the fold,
Building docs with stories untold,
Submodules sync, pnpm spins fast,
Automation's here at last!

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding two new GitHub Actions workflow files (auto-deploy-docs.yml and auto-build-main-module-docs.yml) to automate documentation processes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2025

✅ Preview build completed successfully!

Click the image above to preview.
Preview will be automatically removed when this PR is closed.

@github-actions
Copy link
Contributor

Copy link

@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: 2

🧹 Nitpick comments (2)
.github/workflows/auto-deploy-docs.yml (1)

1-21: Workflow structure looks good overall.

The workflow correctly triggers on pushes to develop affecting docs/** and uses the repository_dispatch API to notify the main docs repository. A few suggestions:

  1. Consider adding --fail to curl to catch HTTP errors.
  2. Optionally include client_payload with commit SHA or branch info for traceability.
🔎 Optional improvement with error handling and payload
     - name: Trigger main repo workflow
       env:
         PAT: ${{ secrets.PAT_TOKEN }}
       run: |
-        curl -X POST \
+        curl -X POST --fail \
           -H "Authorization: token $PAT" \
           -H "Accept: application/vnd.github.v3+json" \
           https://api.github.com/repos/opentiny/docs/dispatches \
-          -d '{"event_type":"submodule-updated"}'
+          -d '{"event_type":"submodule-updated","client_payload":{"sha":"${{ github.sha }}","ref":"${{ github.ref }}"}}'
docs/src/guide/plugin-badge.md (1)

11-13: Minor: Unintentional blank line inside code block?

An extra blank line was added at line 12 before the import statement. This appears accidental and creates inconsistency with the other code blocks in this file (e.g., the one starting at line 30 doesn't have this leading blank line).

🔎 Remove extra blank line
 ```typescript
-
 import { defineConfig } from 'vitepress'
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bbb912c and 8ce3cac.

📒 Files selected for processing (3)
  • .github/workflows/auto-build-main-module-docs.yml
  • .github/workflows/auto-deploy-docs.yml
  • docs/src/guide/plugin-badge.md
🧰 Additional context used
🪛 actionlint (1.7.9)
.github/workflows/auto-build-main-module-docs.yml

31-31: "github.head_ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details

(expression)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build / build
🔇 Additional comments (1)
.github/workflows/auto-build-main-module-docs.yml (1)

63-72: Workflow status check looks good.

The if: always() ensures the status check runs regardless of previous step outcomes. The build outcome check correctly fails the workflow when the build fails.

Comment on lines +50 to +53
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing Node.js setup step.

The pnpm/action-setup action sets up pnpm but doesn't install Node.js. You typically need to add actions/setup-node before or after pnpm setup to ensure Node.js is available.

🔎 Add Node.js setup
       - name: Setup pnpm
         uses: pnpm/action-setup@v3
         with:
           version: 9

+      - name: Setup Node.js
+        uses: actions/setup-node@v4
+        with:
+          node-version: '20'
+          cache: 'pnpm'
+          cache-dependency-path: './docs-main/pnpm-lock.yaml'
+
       - name: Run main repo build
🤖 Prompt for AI Agents
In .github/workflows/auto-build-main-module-docs.yml around lines 50 to 53, the
workflow only sets up pnpm but does not install Node.js; add an
actions/setup-node step (before the pnpm/action-setup step) with a proper
node-version input (e.g., 18 or the project's required version) so Node is
available for pnpm and subsequent steps; ensure setup-node is configured to
match pnpm requirements (optionally enable cache: 'pnpm') and place it
immediately prior to the pnpm setup call.

@github-actions
Copy link
Contributor

🧹 Preview Cleaned Up

The preview deployment has been removed.

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