-
Notifications
You must be signed in to change notification settings - Fork 2
ci: Add check-commits action #2118
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
Conversation
|
Thank you for following naming conventions! 😻 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Reviewer's GuideThis pull request introduces a new GitHub Actions workflow and a Groovy script to prevent accidental merges of specific documentation and configuration files from release branches into the master branch. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Their most recently public accepted PR is: #2117 |
|
""" Walkthrough本次变更引入了一个新的 Groovy 脚本 Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Groovy Script
participant PR Author
GitHub Actions->>Groovy Script: 传入 PR 提交列表,执行检测
Groovy Script->>Groovy Script: 检查每个合并提交
alt 检测到违规合并
Groovy Script-->>GitHub Actions: 非零退出码,输出修复建议
GitHub Actions->>PR Author: 在 PR 下评论告警信息和修复建议
else 未检测到违规
Groovy Script-->>GitHub Actions: 正常退出
end
Assessment against linked issues
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (9)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
|
@unknowIfGuestInDream |
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.
Hey @unknowIfGuestInDream - I've reviewed your changes - here's some feedback:
- Consider making the list of monitored file paths configurable, perhaps via the workflow inputs or a separate configuration file, instead of hardcoding it in the script.
- Improve the robustness of the Groovy script by adding more specific error handling for potential failures when executing external
gitcommands.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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: 4
🧹 Nitpick comments (2)
.github/workflows/CheckBadMerge.groovy (1)
149-151: 使用 Groovyassert作运行时断言在生产脚本里不可靠
Groovy 的assert无法关闭,但抛出的AssertionError信息欠清晰,并会携带大量堆栈,影响 CI 输出可读性。
建议显式抛出自定义异常或直接System.err.println后System.exit(2),以提供更友好的错误信息。.github/workflows/check-commits.yml (1)
25-31: 缺少apt-get update,安装 Groovy 可能失败
在 GitHub Actions 的 ubuntu-latest 镜像上直接apt-get install groovy偶尔会因软件包索引过期而失败。
建议先更新索引。- - name: Install Groovy - run: sudo apt-get install groovy + - name: Install Groovy + run: | + sudo apt-get update + sudo apt-get install -y groovy
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/CheckBadMerge.groovy(1 hunks).github/workflows/check-commits.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: build (21, macos-latest, false)
- GitHub Check: build (21, windows-latest, false)
- GitHub Check: build (17, windows-latest, false)
- GitHub Check: build (17, ubuntu-latest, false)
- GitHub Check: build (21, ubuntu-latest, false)
- GitHub Check: build (17, macos-latest, false)
- GitHub Check: qodana
- GitHub Check: StepSecurity Harden-Runner
- GitHub Check: Summary
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Close: #2101 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
e502ee9 to
03388e0
Compare
Close: #2101 Signed-off-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
|



Close: #2101
Fixes #
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
enhancement,bug,documentationordependenciesSummary by Sourcery
Add a GitHub Actions workflow to check for problematic merge commits from release branches to the master branch
New Features:
CI:
Summary by CodeRabbit