Skip to content

ci: deploy documentation with reusable workflow - #884

Merged
zombieJ merged 1 commit into
masterfrom
agent/deploy-pages
Jul 27, 2026
Merged

ci: deploy documentation with reusable workflow#884
zombieJ merged 1 commit into
masterfrom
agent/deploy-pages

Conversation

@zombieJ

@zombieJ zombieJ commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • deploy documentation on published releases and manual dispatches
  • reuse the shared react-component Pages workflow

Verification

  • validated by the shared Pages build after merge

Summary by CodeRabbit

  • 新功能
    • 新增文档页面自动部署流程,支持发布新版本时自动部署。
    • 支持手动触发文档页面部署。

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
menu Ready Ready Preview, Comment Jul 27, 2026 9:08am

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

新增文档页面部署工作流,支持发布完成或手动触发,并通过复用的远程工作流执行部署。

Changes

页面部署

Layer / File(s) Summary
页面部署工作流配置
.github/workflows/deploy-pages.yml
配置发布和手动触发、Pages 部署所需权限,并调用外部 deploy-pages.yml@main 工作流执行部署。

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

兔子敲键盘,
页面随风展。
发布一声响,
文档上云端。
手动也能跳,
胡萝卜庆团圆。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题简洁明确,准确概括了通过可复用工作流部署文档这一主要变更。
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/deploy-pages

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.

@github-actions

Copy link
Copy Markdown

React Doctor could not complete this scan.

react-doctor exited with status 0 before producing a JSON report.

Report this bug

Reviewed by React Doctor for commit 903a079.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (02b5d46) to head (903a079).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #884   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          26       26           
  Lines         734      734           
  Branches      205      205           
=======================================
  Hits          732      732           
  Misses          2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-menu-preview-pr-884.surge.sh (may be unavailable)
📝 Commit903a079
🪵 LogsView logs
📋 Build log (last lines)
npm error
npm error Could not resolve dependency:
npm error peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" from eslint-plugin-react@7.37.5
npm error node_modules/eslint-plugin-react
npm error   dev eslint-plugin-react@"^7.37.5" from the root project
npm error   eslint-plugin-react@"^7.32.2" from @umijs/fabric@4.0.1
npm error   node_modules/@umijs/fabric
npm error     @umijs/fabric@"^4.0.0" from rc-test@7.1.3
npm error     node_modules/rc-test
npm error       dev rc-test@"^7.1.3" from the root project
npm error
npm error Conflicting peer dependency: eslint@9.39.5
npm error node_modules/eslint
npm error   peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" from eslint-plugin-react@7.37.5
npm error   node_modules/eslint-plugin-react
npm error     dev eslint-plugin-react@"^7.37.5" from the root project
npm error     eslint-plugin-react@"^7.32.2" from @umijs/fabric@4.0.1
npm error     node_modules/@umijs/fabric
npm error       @umijs/fabric@"^4.0.0" from rc-test@7.1.3
npm error       node_modules/rc-test
npm error         dev rc-test@"^7.1.3" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/runner/.npm/_logs/2026-07-27T09_09_03_078Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-07-27T09_09_03_078Z-debug-0.log

🤖 Powered by surge-preview

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy-pages.yml:
- Line 15: 将 deploy-pages.yml 中引用的外部可复用工作流从可变的 `@main` 更新为对应版本的完整 40 位 commit
SHA,确保调用的工作流版本不可变;仅修改 uses 引用,保留现有工作流路径和权限配置不变。
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e3156478-7a19-46a3-bba2-46bb9e116672

📥 Commits

Reviewing files that changed from the base of the PR and between 02b5d46 and 903a079.

📒 Files selected for processing (1)
  • .github/workflows/deploy-pages.yml


jobs:
deploy:
uses: react-component/rc-test/.github/workflows/deploy-pages.yml@main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
git ls-files | rg '(^|/)\.github/workflows/deploy-pages\.yml$|\.github/workflows/' || true

echo "== deploy-pages.yml =="
if [ -f .github/workflows/deploy-pages.yml ]; then
  cat -n .github/workflows/deploy-pages.yml
else
  echo "not found"
fi

echo "== search reusable workflow uses refs =="
rg -n "uses:\s*[^#]+\.github/workflows/[^@]+@[^ ]+" .github/workflows || true

echo "== try resolve upstream ref =="
ref="react-component/rc-test:.github/workflows/deploy-pages.yml@main"
json="$(gh api "repos/react-component/rc-test/contents/.github/workflows/deploy-pages.yml?ref=main" --jq '{ref,sha,download_url}' 2>/dev/null || true)"
echo "$json" || true

Repository: react-component/menu

Length of output: 1191


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect repository configuration for branch protection / pinning policies if present.
for f in .github/dependabot.yml .github/pinned-actions.txt .github/workflows/.gitignore 2>/dev/null; do
  [ -f "$f" ] && { echo "== $f =="; cat -n "$f"; }
done

# List workflow files and whether they use refs other than commit SHAs in reusable workflow calls.
python3 - <<'PY'
from pathlib import Path
import re
for p in sorted(Path('.github/workflows').glob('*.yml')) + sorted(Path('.github/workflows').glob('*.yaml')):
    text = p.read_text(errors='replace')
    for m in re.finditer(r'uses:\s*(.+)@(.+)(?:\s*(#.*)?)?', text):
        workflow, ref, comment = m.groups()
        print(f"{p}: uses={workflow} ref={ref} comment={comment}")
PY

Repository: react-component/menu

Length of output: 211


将外部可复用工作流固定到完整 commit SHA。

当前 @main 会随上游分支变化;该工作流拥有 pages: writeid-token: write 权限,若上游代码被意外或恶意修改,发布流程会直接执行新代码。将其固定到完整 40 位 commit SHA 可保证调用版本不可变。

建议修改
-    uses: react-component/rc-test/.github/workflows/deploy-pages.yml@main
+    uses: react-component/rc-test/.github/workflows/deploy-pages.yml@<完整的40位commit SHA>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy-pages.yml at line 15, 将 deploy-pages.yml
中引用的外部可复用工作流从可变的 `@main` 更新为对应版本的完整 40 位 commit SHA,确保调用的工作流版本不可变;仅修改 uses
引用,保留现有工作流路径和权限配置不变。

Source: MCP tools

@zombieJ
zombieJ merged commit 01887f0 into master Jul 27, 2026
13 of 15 checks passed
@zombieJ
zombieJ deleted the agent/deploy-pages branch July 27, 2026 09:09
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