Skip to content

ci: deploy documentation with reusable workflow - #800

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

ci: deploy documentation with reusable workflow#800
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)
util Ready Ready Preview, Comment Jul 27, 2026 10:37am

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

新增 GitHub Actions 工作流,在发布完成或手动触发时,通过复用的工作流部署文档页面,并配置所需权限。

Changes

文档页面部署

Layer / File(s) Summary
部署工作流配置
.github/workflows/deploy-pages.yml
新增“Deploy documentation”工作流,支持发布完成和手动触发,配置 contents 只读、pagesid-token 写入权限,并调用复用的页面部署工作流。

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

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-util-preview-pr-800.surge.sh
📝 Commit712a341
⏱️ Build time34.72s
📦 Size1.7 MB · 45 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ 712a341 · react-component-util-preview-pr-800.surge.sh (open ↗) · 2026-07-27 10:38:30 UTC

🤖 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 工作流的 uses 引用从可变的 `@main` 更新为经过审阅的完整 commit
SHA,并保留注释标明对应的版本号,以固定第三方工作流内容。
🪄 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: 73114c31-dcd9-4b41-98a4-8f72545de5fe

📥 Commits

Reviewing files that changed from the base of the PR and between 21f1ed7 and 712a341.

📒 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 "== workflow file =="
if [ -f .github/workflows/deploy-pages.yml ]; then
  nl -ba .github/workflows/deploy-pages.yml | sed -n '1,220p'
else
  echo "missing .github/workflows/deploy-pages.yml"
fi

echo
echo "== changed files/stat =="
git diff --stat HEAD~1..HEAD 2>/dev/null || true

echo
echo "== search permissions/deploy references =="
rg -n "permissions:|pages:|id-token|deploy-pages|uses: react-component/rc-test" .github/workflows . -g '!node_modules' || true

Repository: react-component/util

Length of output: 218


🌐 Web query:

GitHub Actions reusable workflows workflow_file use commit full SHA security mutable refs security hardening

💡 Result:

To securely reference GitHub Actions reusable workflows, you must use a full-length commit SHA [1][2][3]. When calling a reusable workflow with the syntax {owner}/{repo}/.github/workflows/{filename}@{ref}, the {ref} component is mutable if it is a branch name or a tag [2][4]. A mutable reference allows the owner of the workflow repository to modify the code, which immediately impacts every downstream caller [2]. Using a full-length commit SHA (e.g., @a1b2c3d...) makes the reference immutable, ensuring that callers always execute the exact same version of the workflow [1][2]. Security Hardening Recommendations: 1. Pin Everything: Use full-length commit SHAs for all reusable workflows and actions [2][5][3]. This mitigates the risk of supply chain attacks where a tag or branch is overwritten with malicious code [2][5]. 2. Maintain Readability: While the pin must be a SHA, you can (and should) include the human-readable version tag as a comment in the same line for easier tracking (e.g., uses: owner/repo/.github/workflows/file.yml@a1b2c3d... # v1.2.3) [2][6]. 3. Automate Maintenance: Use dependency management tools like Dependabot or Renovate to automatically update these SHA pins as new versions are released [2]. 4. Enable Enterprise/Organization Policies: If your organization uses GitHub Enterprise or GitHub Team, enable the "Require actions to be pinned to a full-length commit SHA" policy [4][5][3]. Note that while this policy is essential, it may not recursively validate every nested reference in a complex reusable workflow chain, so manual audits or custom "pin-check" workflows are recommended to ensure comprehensive coverage [4][6][7]. 5. Audit Transitive Dependencies: Because reusable workflows inherit the caller's secrets and execution context, a compromise in the reusable workflow—or any action it calls—effectively compromises the caller's environment [2][4]. Ensure the reusable workflow itself also pins all its internal actions to full SHAs [2]. If you omit the @{ref} and reference a file within the same repository (e.g.,./.github/workflows/{filename}), GitHub automatically uses the workflow file from the same commit as the caller, which provides an immutable, secure binding by default [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== workflow file =="
if [ -f .github/workflows/deploy-pages.yml ]; then
  cat -n .github/workflows/deploy-pages.yml | sed -n '1,220p'
else
  echo "missing .github/workflows/deploy-pages.yml"
fi

echo
echo "== search permissions/deploy references =="
rg -n "permissions:|pages:|id-token|deploy-pages|uses: react-component/rc-test" .github/workflows . || true

Repository: react-component/util

Length of output: 1161


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

这里通过 @main 复用第三方工作流,而它配置了 pages: writeid-token: write,上游分支的后续变更会直接影响发布流程。应改为经过审阅的完整 commit SHA,例如 @<reviewed-full-commit-sha> # vX.Y.Z

🤖 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 工作流的 uses
引用从可变的 `@main` 更新为经过审阅的完整 commit SHA,并保留注释标明对应的版本号,以固定第三方工作流内容。

@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 86.72%. Comparing base (21f1ed7) to head (712a341).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #800   +/-   ##
=======================================
  Coverage   86.72%   86.72%           
=======================================
  Files          40       40           
  Lines        1092     1092           
  Branches      380      395   +15     
=======================================
  Hits          947      947           
  Misses        143      143           
  Partials        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.

@zombieJ
zombieJ merged commit 590be3b into master Jul 27, 2026
12 checks passed
@zombieJ
zombieJ deleted the agent/deploy-pages branch July 27, 2026 10:38
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