ci: deploy documentation with reusable workflow - #321
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新增 GitHub Actions 文档部署工作流,支持发布完成或手动触发,并通过复用工作流部署 GitHub Pages。 Changes文档部署
Estimated code review effort: 1 (Trivial) | ~5 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 #321 +/- ##
=======================================
Coverage 99.35% 99.35%
=======================================
Files 7 7
Lines 156 156
Branches 52 51 -1
=======================================
Hits 155 155
Misses 1 1 ☔ 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 可复用工作流的引用从不固定的 `@main` 更新为完整 commit SHA
1afe200f7e3a6ccbafbc6ed0142cb5762ae9ce02,保持现有工作流调用方式和权限配置不变。
🪄 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: aa352081-2e15-4e5e-a19d-75def668633a
📒 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 -eu
sha="$(git ls-remote https://github.com/react-component/rc-test.git refs/heads/main | awk '{print $1}')"
test "${`#sha`}" -eq 40
workflow="$(curl -fsSL \
"https://raw.githubusercontent.com/react-component/rc-test/${sha}/.github/workflows/deploy-pages.yml")"
printf '%s\n' "$workflow" | grep -Eq '^[[:space:]]+workflow_call:'
echo "Verified workflow SHA: ${sha}"Repository: react-component/progress
Length of output: 226
🏁 Script executed:
#!/bin/bash
set -eu
sha="1afe200f7e3a6ccbafbc6ed0142cb5762ae9ce02"
workflow_file=".github/workflows/deploy-pages.yml"
printf '%s\n' "--- workflow_call/in-permissions/inputs section ---"
python3 - <<'PY'
import pathlib, re
p = pathlib.Path('.github/workflows/deploy-pages.yml')
text = p.read_text()
for pat in [r'(?m)^[ \t]*workflow_call:[ \t]*[\s\S]*?(?=^\S|\Z)',
r'(?m)^[ \t]*permissions:([\s\S]*?)(?=^ [^ ]|^\Z)',
r'(?m)^[ \t]*on:([\s\S]*?)(?=^ [^ ]|^\Z)']:
m = re.search(pat, text)
print(m.group(0) if m else '--- pattern not found: ' + pat + ' ---')
PY
printf '%s\n' "--- current use directive ---"
rg -n 'uses: react-component/rc-test/.github/workflows/deploy-pages.yml' "$workflow_file" -C 3
printf '%s\n' "--- target workflow relevant sections ---"
curl -fsSL "https://raw.githubusercontent.com/react-component/rc-test/${sha}/.github/workflows/deploy-pages.yml" | sed -n '1,220p'Repository: react-component/progress
Length of output: 2003
将外部可复用工作流固定到完整 commit SHA。
当前使用 @main,上游分支后续变更仍会直接获得本仓库的 pages: write 和 id-token: write 权限。已确认可复用工作流声明了 workflow_call 且无必需输入,可直接替换为完整 SHA(1afe200f7e3a6ccbafbc6ed0142cb5762ae9ce02),避免上游变更或供应链攻击影响 Pages 部署。
🤖 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 可复用工作流的引用从不固定的
`@main` 更新为完整 commit SHA
1afe200f7e3a6ccbafbc6ed0142cb5762ae9ce02,保持现有工作流调用方式和权限配置不变。

Summary
Verification
Summary by CodeRabbit