ci(代码规范检查): 添加 Git Commit Angular 风格检查工作流#13
Merged
Frankoul merged 4 commits intoembyplus:mainfrom Feb 11, 2025
Merged
Conversation
- 新增 GitHub Actions 工作流,检查 PR 中的提交信息是否符合 Angular 规范 - 在 PR 创建、更新或重新打开时,以及推送至 main 分支时触发检查 - 使用正则表达式验证提交信息的格式 - 如果提交信息不符合规范,自动关闭 PR
文件级别更改
提示和命令与 Sourcery 互动
自定义您的体验访问您的 仪表板 以:
获得帮助Original review guide in EnglishReviewer's Guide by SourceryThis pull request adds a new GitHub Actions workflow that enforces Angular commit message standards and updates the documentation to include contribution guidelines. The changes include implementing automated commit message validation and enforcing the standard by automatically closing non-compliant pull requests, as well as updating the project readme with detailed contribution steps. Sequence diagram for GitHub Actions Commit Check WorkflowsequenceDiagram
actor Developer as Contributor
participant PR_Event as "Pull Request Event"
participant Workflow as "GitHub Actions Workflow"
participant GitAPI as "GitHub API"
Developer->>PR_Event: Opens/updates PR
PR_Event->>Workflow: Trigger commit-check workflow
Workflow->>Workflow: Checkout repository
Workflow->>Workflow: Retrieve commit messages
Workflow->>Workflow: Validate commit messages against Angular regex
alt Commit messages are valid
Workflow->>Workflow: Continue workflow (PR remains open)
else Commit messages are invalid
Workflow->>GitAPI: PATCH PR state to "closed"
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @linhemin - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider using a pre-built action for commit message validation to simplify the workflow configuration.
- The workflow currently closes the PR on invalid commits; consider adding a comment to the PR explaining why it was closed.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: 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.
Replace deprecated echo "::set-output name=messages::$COMMITS" with echo "messages=$COMMITS" >> $GITHUB_OUTPUT in the GitHub Actions workflow.
Contributor
Author
|
@sourcery-ai review |
Contributor
Author
|
@sourcery-ai review |
- 使用 EOF 标记替代单行输出,以正确处理多行提交信息 - 优化了 GitHub Actions 工作流中的变量输出方式
Contributor
Author
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.
好的,这是将 pull request 总结翻译成中文的结果:
Sourcery 总结
CI:
Original summary in English
好的,这是翻译成中文的 pull request 总结:
Sourcery 总结
添加一个 GitHub Actions 工作流程来强制执行 Angular commit message 规范。
CI:
文档:
Original summary in English
Summary by Sourcery
Add a GitHub Actions workflow to enforce the Angular commit message convention.
CI:
Documentation: