-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add auto-deploy-docs and auto-build-main-module-docs yml #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughTwo 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks✅ Passed checks (3 passed)
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. Comment |
📦 Package Previewpnpm add https://pkg.pr.new/opentiny/tiny-robot/@opentiny/tiny-robot@8ce3cac pnpm add https://pkg.pr.new/opentiny/tiny-robot/@opentiny/tiny-robot-kit@8ce3cac pnpm add https://pkg.pr.new/opentiny/tiny-robot/@opentiny/tiny-robot-svgs@8ce3cac commit: 8ce3cac |
There was a problem hiding this 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
developaffectingdocs/**and uses the repository_dispatch API to notify the main docs repository. A few suggestions:
- Consider adding
--failto curl to catch HTTP errors.- Optionally include
client_payloadwith 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
📒 Files selected for processing (3)
.github/workflows/auto-build-main-module-docs.yml.github/workflows/auto-deploy-docs.ymldocs/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.
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
🧹 Preview Cleaned UpThe preview deployment has been removed. |

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