Skip to content

ci: deploy documentation with reusable workflow#715

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

ci: deploy documentation with reusable workflow#715
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

  • 新功能
    • 新增文档自动部署流程,支持在发布版本后自动部署到 GitHub Pages。
    • 支持手动触发文档部署。

@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)
pagination Ready Ready Preview, Comment Jul 27, 2026 9:19am

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

新增 GitHub Pages 部署工作流,支持 release 发布事件和手动触发,并通过远程复用工作流执行部署。

Changes

文档部署

Layer / File(s) Summary
部署工作流配置
.github/workflows/deploy-pages.yml
新增部署工作流,配置发布事件与手动触发、最小权限,并调用远程复用工作流完成 GitHub Pages 部署。

Estimated code review effort: 1 (Trivial) | ~3 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 b06d8f6.

@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.69%. Comparing base (61ee8c0) to head (b06d8f6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #715   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files           4        4           
  Lines         331      331           
  Branches      152      152           
=======================================
  Hits          330      330           
  Misses          1        1           

☔ 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.

@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.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-pagination-preview-pr-715.surge.sh (may be unavailable)
📝 Commitb06d8f6
🪵 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_20_46_277Z-eresolve-report.txt
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-07-27T09_20_46_277Z-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 工作流的 uses 引用从可变的 main 分支改为已审核的完整 commit SHA,并确认该提交仍提供
workflow_call 接口;保持其余工作流配置不变。
🪄 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: e4fbe36f-1b34-4bf9-b5e7-5505f17f862f

📥 Commits

Reviewing files that changed from the base of the PR and between 61ee8c0 and b06d8f6.

📒 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,80p'
else
  echo "missing .github/workflows/deploy-pages.yml"
fi

echo
echo "== references to rc-test deploy-pages =="
rg -n "rc-test/.github/workflows/deploy-pages|workflow_call|workflow_dispatch|on:\s*\[" .github/workflows || true

echo
echo "== changed files/stat =="
git diff --stat || true
git diff --name-only || true

Repository: react-component/pagination

Length of output: 224


🌐 Web query:

GitHub Actions reusable workflows trigger workflow_call on remote workflow file documentation

💡 Result:

To trigger a reusable workflow from another file or repository, you must use the workflow_call event [1][2]. This event allows a workflow to be invoked by another workflow, known as a caller workflow [1][3]. Key Configuration Requirements: 1. Enable the trigger: In the target workflow file that you intend to reuse (the called workflow), you must include the workflow_call event in its on section [1][4]. on: workflow_call: 2. Call the workflow: In your caller workflow, use the uses keyword within a job to reference the remote or local workflow file [1][5]. The syntax requires the repository path, file path, and a reference (tag, branch, or commit SHA) [5]. jobs: call-reusable: uses: owner/repo/.github/workflows/reusable-workflow.yml@v1 Important Considerations: - Location: Reusable workflows must be located in the.github/workflows directory of the repository [1]. Subdirectories are not supported [1]. - Access: If the reusable workflow resides in a private repository, it can only be accessed by other workflows within that same private repository [2]. - Execution Context: When a workflow is called from a different repository, the actions within the called workflow execute as if they were part of the caller workflow [3]. For example, if the called workflow checks out code, it will check out the caller repository's code, not the repository where the reusable workflow file is stored [3]. - Data Passing: You can pass inputs and secrets to the reusable workflow using the with and secrets keywords within the job configuration [1][6]. Data types for inputs must match those defined in the called workflow [1]. For detailed documentation, refer to the official GitHub Actions guide on reusing workflows [1].

Citations:


🏁 Script executed:

#!/bin/bash
set -u

echo "== workflow file =="
if [ -f .github/workflows/deploy-pages.yml ]; then
  awk '{printf "%6d\t%s\n", NR, $0}' .github/workflows/deploy-pages.yml | sed -n '1,100p'
else
  echo "missing .github/workflows/deploy-pages.yml"
fi

echo
echo "== references to rc-test deploy-pages =="
rg -n "rc-test/.github/workflows/deploy-pages|workflow_call|workflow_dispatch|secrets|with:" .github/workflows || true

echo
echo "== changed files/stat =="
git diff --stat || true
git diff --name-only || true

echo
echo "== remote referenced workflow header via HTTP =="
python3 - <<'PY'
import urllib.request
url = 'https://raw.githubusercontent.com/react-component/rc-test/main/.github/workflows/deploy-pages.yml'
try:
    req = urllib.request.Request(url,headers={'User-Agent':'CodeRabbit-verify'})
    resp = urllib.request.urlopen(req, timeout=20)
    body = resp.read().decode('utf-8', 'replace')
    lines = body.splitlines()
    print(f"status={getattr(resp, 'status')}")
    print(f"first 80 lines:")
    for i, line in enumerate(lines[:80], 1):
        print(f"{i}: {line}")
    print(f"has workflow_call: {'workflow_call' in body}")
    print(f"repo_path: react-component/rc-test/.github/workflows/deploy-posts.yml?.git?")
    print(f"path: deploy-pages.yml")
except Exception as e:
    print(f"ERROR {e.__class__.__name__}: {e}")
PY

Repository: react-component/pagination

Length of output: 1684


🌐 Web query:

github actions reusable workflow @main fixed commit SHA pin best practice

💡 Result:

Pinning GitHub Actions reusable workflows to a full-length commit SHA is considered a security and stability best practice [1][2][3]. Unlike tags (e.g., @v1) or branches (e.g., @main), which are mutable and can be updated to point to malicious or breaking code, a commit SHA is immutable, ensuring the workflow always executes the exact code you have reviewed and verified [4][5]. Best practices for managing reusable workflow references include: 1. Always Pin to Full SHA: Use the full-length commit SHA (not the short version) in your workflow reference syntax: uses: owner/repo/.github/workflows/workflow.yml@a1b2c3d4... [2][5]. 2. Maintain Human-Readable References: While pinning to the SHA, it is common practice to include the original tag or branch name in a trailing comment to improve readability: uses: owner/repo/.github/workflows/workflow.yml@a1b2c3d4 # v1.0.0 [6]. 3. Automate Updates: Use automated tools such as Dependabot or Renovate to maintain these pins. These tools are designed to detect when a new release tag is available and can automatically propose a pull request to update the SHA pin, keeping you secure without manual tracking [5][6]. 4. Enforce via Organization Policy: If you are an administrator, you can enforce this requirement across your organization. GitHub allows you to set an organization-level policy to "Require actions to be pinned to a full-length commit SHA," which will cause any workflow using non-SHA references to fail [4][7]. 5. Audit Sub-dependencies: Remember that reusable workflows may themselves call other actions or workflows. Security best practices require that these sub-dependencies are also pinned to SHAs, as they are otherwise invisible to the primary caller [4][5][6]. You can use tools or scripts to walk the call graph and verify that all downstream references are also pinned [4]. 6. Beware of Impostor Commits: When pinning, ensure the commit belongs to the expected repository. Some security tools (such as Zizmor) can help detect "impostor commits" to prevent dependency confusion attacks [8]. By moving from mutable tags to immutable SHAs, you minimize the risk of supply chain attacks where a compromised tag could inject malicious steps into your CI/CD pipelines [2][6].

Citations:


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

.github/workflows/deploy-pages.yml:15react-component/rc-test/.github/workflows/deploy-pages.yml@main 指向可变分支,会随上游更新改变文档部署行为并增加供应链风险。改用已审核的完整 commit SHA,并确认该提交仍暴露 workflow_call 接口。

🤖 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,并确认该提交仍提供 workflow_call 接口;保持其余工作流配置不变。

Source: Learnings

@zombieJ
zombieJ merged commit b9c2407 into master Jul 27, 2026
12 of 14 checks passed
@zombieJ
zombieJ deleted the agent/deploy-pages branch July 27, 2026 09:21
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