Chore/update docs workflow #15
Merged
Merged
Conversation
- 修改标签匹配模式从 '*' 到 'v*' 以确保版本标签格式一致性 - 添加条件判断逻辑以精确控制工作流触发时机 - 增加对预发布标签的过滤处理 - 为手动文档发布增加分支合并条件支持
- 将 Node.js 设置替换为 Bun.js 安装 - 更新依赖安装命令从 npm 到 bun - 更新构建命令从 npm run build 到 bun run build - 移除缓存配置选项
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The job-level
ifcondition referencesgithub.event.head_commit.message, which may be undefined for tag pushes and can cause evaluation errors; consider explicitly guarding withgithub.event_name == 'push' && github.ref == 'refs/heads/main'before accessinghead_commit. - Using
bun-version: latestmakes 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
- 修复了触发文档发布的条件逻辑 - 指定Bun.js版本为2.1.x以确保兼容性 - 移除了不必要的分支检查条件
This was referenced Mar 15, 2026
This was referenced May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
CI: