将 PR Checkstyle 报告同步至 Pull Request 审查评论 - #6692
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7ef111911
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e940f016e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 346aab98c2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
新增安全的特权工作流,将 Checkstyle 报告发布为 PR 审查评论。
Changes:
- 生成并上传 reviewdog JSONL 报告。
- 验证 PR 来源后创建行内审查评论。
- 优化脚本的 sparse checkout。
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/pr-size-label.yml |
精确检出标签脚本。 |
.github/workflows/check-codes.yml |
生成并上传 Checkstyle 报告。 |
.github/workflows/check-codes-comment.yml |
下载报告并触发评论脚本。 |
.github/scripts/check-codes-comment.js |
验证运行来源并发布审查评论。 |
Suppressed comments (1)
.github/scripts/check-codes-comment.js:108
- This catch also leaves the workflow green when the review API rejects the payload, even though its sole purpose was not completed. Mark the step failed or rethrow so maintainers can detect and retry publication failures.
core.error(`Failed to post review comments to GitHub: ${error.message}`);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
.github/scripts/check-codes-comment.js:106
- Each rerun of the same failed
Check Codesworkflow emits anotherworkflow_runevent, and this unconditional call creates an identical review for the same commit. Re-running a failed check will therefore duplicate all bot comments. Before creating the review, detect an existing bot review for this workflow marker andrun.head_sha(or otherwise make publication idempotent).
await github.rest.pulls.createReview({
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
普通用户没有重新运行工作流的权限;即便重新执行,也只是额外触发一次审核评论。综合评估实现成本与带来的收益,个人认为该方案性价比不高,没有实现的必要。 |
通过 pull_request 事件触发的工作流是没有发布 review comment 的权限的,因此额外添加了一个 Check Codes Comment 工作流用于将 reviewdog 生成的 jsonl 报告转为 review comment
https://github.com/reviewdog/reviewdog
https://github.com/reviewdog/action-setup
https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
https://github.com/neveler/HMCL/pull/8