Skip to content

Chore/update docs workflow #15

Merged
GeWuYou merged 3 commits into
mainfrom
chore/update-docs-workflow-
Feb 11, 2026
Merged

Chore/update docs workflow #15
GeWuYou merged 3 commits into
mainfrom
chore/update-docs-workflow-

Conversation

@GeWuYou

@GeWuYou GeWuYou commented Feb 11, 2026

Copy link
Copy Markdown
Owner

Summary by Sourcery

CI:

  • Restrict the docs publish workflow to version tags starting with 'v' and gated main-branch commits, and migrate the build steps from Node/npm to Bun.

- 修改标签匹配模式从 '*' 到 'v*' 以确保版本标签格式一致性
- 添加条件判断逻辑以精确控制工作流触发时机
- 增加对预发布标签的过滤处理
- 为手动文档发布增加分支合并条件支持
- 将 Node.js 设置替换为 Bun.js 安装
- 更新依赖安装命令从 npm 到 bun
- 更新构建命令从 npm run build 到 bun run build
- 移除缓存配置选项
@sourcery-ai

sourcery-ai Bot commented Feb 11, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the docs publish GitHub Actions workflow to only trigger on version tags or explicit release commits, and switches the docs build from Node/npm to Bun.

File-Level Changes

Change Details Files
Restrict workflow triggers to version tags and specific main-branch release commits.
  • Change tag trigger pattern from all tags to only tags starting with 'v'.
  • Add an if condition on the job to run for version tags without prerelease suffixes.
  • Allow running on main only when the head commit message contains a specific release marker.
.github/workflows/publish-docs.yml
Migrate docs build tooling in the workflow from Node/npm to Bun.
  • Replace actions/setup-node with oven-sh/setup-bun using the latest Bun version.
  • Switch dependency installation from npm install to bun install in the docs directory.
  • Switch build command from npm run build to bun run build in the docs directory.
  • Update inline comments to reference Bun instead of Node.
.github/workflows/publish-docs.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Hey - I've found 2 issues, and left some high level feedback:

  • The job-level if condition references github.event.head_commit.message, which may be undefined for tag pushes and can cause evaluation errors; consider explicitly guarding with github.event_name == 'push' && github.ref == 'refs/heads/main' before accessing head_commit.
  • Using bun-version: latest makes the workflow non-deterministic over time; consider pinning Bun to a specific major/minor version to keep docs builds reproducible.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The job-level `if` condition references `github.event.head_commit.message`, which may be undefined for tag pushes and can cause evaluation errors; consider explicitly guarding with `github.event_name == 'push' && github.ref == 'refs/heads/main'` before accessing `head_commit`.
- Using `bun-version: latest` makes the workflow non-deterministic over time; consider pinning Bun to a specific major/minor version to keep docs builds reproducible.

## Individual Comments

### Comment 1
<location> `.github/workflows/publish-docs.yml:21-22` </location>
<code_context>
 jobs:
   build-and-deploy:
+    if: |
+      (startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-'))
+      || (github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[release doc]'))
     runs-on: ubuntu-latest

</code_context>

<issue_to_address>
**issue (bug_risk):** The `main` branch condition in `if:` can never be true with the current trigger configuration.

Because this workflow only runs on `push` to tags (`on.push.tags: 'v*'`), the `github.ref == 'refs/heads/main'` condition will never be true here. If you want to publish docs from `main` with `[release doc]` in the commit message, add a `branches: [main]` (or similar) under `on.push`. If not, remove the `main` branch part of the `if:` to avoid dead code.
</issue_to_address>

### Comment 2
<location> `.github/workflows/publish-docs.yml:37` </location>
<code_context>
-          node-version: 20
-          cache: 'npm'
-
+          bun-version: latest
       # 3️⃣ 安装依赖
       - name: Install Dependencies
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Using `bun-version: latest` reduces reproducibility and may cause unexpected breakages.

Please pin Bun to a specific version or at least a major/minor range to keep the docs build reproducible and avoid CI breakages when Bun releases new versions (e.g. `bun-version: 1.1.x` or a known-good explicit version).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/publish-docs.yml Outdated
Comment thread .github/workflows/publish-docs.yml Outdated
- 修复了触发文档发布的条件逻辑
- 指定Bun.js版本为2.1.x以确保兼容性
- 移除了不必要的分支检查条件
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