ci: deploy documentation with reusable workflow - #884
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough新增文档页面部署工作流,支持发布完成或手动触发,并通过复用的远程工作流执行部署。 Changes页面部署
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
React Doctor could not complete this scan.
Reviewed by React Doctor for commit |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/deploy-pages.yml
|
|
||
| jobs: | ||
| deploy: | ||
| uses: react-component/rc-test/.github/workflows/deploy-pages.yml@main |
There was a problem hiding this comment.
🔒 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" || trueRepository: 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}")
PYRepository: react-component/menu
Length of output: 211
将外部可复用工作流固定到完整 commit SHA。
当前 @main 会随上游分支变化;该工作流拥有 pages: write 和 id-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

Summary
Verification
Summary by CodeRabbit