-
Notifications
You must be signed in to change notification settings - Fork 489
chore: add pkg.pr.new #909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
概述演练一个新的 GitHub Actions 工作流文件 变更
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #909 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 14 14
Lines 1275 1275
Branches 392 392
=======================================
Hits 1273 1273
Misses 2 2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/pkg.pr.new.yml (1)
17-19
: 优化依赖安装性能建议添加依赖缓存以提高工作流执行速度。
在 setup-node 步骤后添加缓存配置:
- uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - name: Install dependencies run: npm install
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/pkg.pr.new.yml
(1 hunks)package.json
(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/pkg.pr.new.yml
[error] 14-14: trailing spaces
(trailing-spaces)
🔇 Additional comments (4)
.github/workflows/pkg.pr.new.yml (3)
1-2
: 优化工作流触发器配置工作流同时在 push 和 pull_request 事件上触发会导致重复运行。建议根据具体需求选择合适的触发条件。
name: Publish Any Commit -on: [push, pull_request] +on: + push: + branches: + - main + - master + pull_request: + types: [opened, synchronize]
18-20
: 添加测试步骤在编译之后、发布之前应当添加测试步骤以确保代码质量。
- name: Build run: npm run compile + - name: Test + run: npm test
21-21
:⚠️ Potential issue配置发布认证
当前发布步骤缺少必要的 NPM 认证配置,这可能导致发布失败。同时建议限制发布条件,只在特定情况下执行发布操作。
+ - name: Configure npm + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + - - run: bunx pkg-pr-new publish + - name: Publish + if: startsWith(github.ref, 'refs/tags/v') + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}Likely invalid or redundant comment.
package.json (1)
73-73
: 评估发布工具的必要性注意到以下几点:
- package.json 中已经配置了
prepublishOnly
脚本,使用np
进行发布管理- 新添加的
pkg-pr-new
依赖版本为 0.0.39,属于早期开发版本- 两种发布方式可能产生冲突
建议:
- 评估是否确实需要更换发布工具
- 如果确定使用 pkg-pr-new,建议移除现有的 np 相关配置
- 考虑使用更稳定的发布工具版本
- "pkg-pr-new": "^0.0.39",
✅ Verification successful
Let me gather more information about the publishing configuration and dependencies.
确认发现发布配置冲突
经验证,代码库中确实存在发布工具配置冲突:
- 现有配置使用
np
(v10.0.5) 作为发布工具,且已在prepublishOnly
脚本中配置- 新添加的
pkg-pr-new
(v0.0.39) 为早期开发版本- 两个发布工具并存可能导致发布流程混乱
建议:
- 移除
pkg-pr-new
依赖,继续使用当前稳定的np
发布工具- 如确实需要更换发布工具,应先移除
np
相关配置,并详细说明更换原因🏁 Scripts executed
The following scripts were executed for the analysis:
Error: No shell scripts found
Script:
#!/bin/bash # Check package.json for publishing related configurations and dependencies cat package.json | jq '.scripts + {dependencies: .dependencies, devDependencies: .devDependencies}'Length of output: 1645
Summary by CodeRabbit
"pkg-pr-new": "^0.0.39"
用于开发环境