Conversation
Automatically validate that PR authors fill in required template sections (What/Why/release-note) and remind on new pushes to review the description. Co-Authored-By: Claude Opus 4.6 <[email protected]>
EurFelux
left a comment
There was a problem hiding this comment.
Thanks for adding this workflow. I found one issue to address before merge: the synchronize reminder currently uses pulls.listCommits without pagination handling, so the “latest commits” list can be incorrect on large PRs. Please fetch commits with pagination awareness (or another bounded latest-window approach) before selecting the latest 3.
The notify-sync job used pulls.listCommits without pagination, so commits.slice(-3) could return wrong results on PRs with 30+ commits. Now fetches with per_page=3 and checks the Link header to jump to the last page when multiple pages exist. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
EurFelux
left a comment
There was a problem hiding this comment.
Thanks for the quick update. Pagination handling is improved, but one edge case remains: when commit count is not a multiple of 3, fetching only the last page with per_page=3 may return fewer than the true latest three commits. Please adjust the fetch logic to guarantee exactly the latest three commits when at least three exist.
Replace manual Link header pagination with github.paginate() to guarantee exactly the latest 3 commits regardless of total count. Co-Authored-By: Claude Opus 4.6 <[email protected]>
EurFelux
left a comment
There was a problem hiding this comment.
Re-review complete for the commit-list pagination finding. The implementation now uses github.paginate(...) and then takes the last 3 commits, which resolves the previously reported inaccuracy on large PRs.
There was a problem hiding this comment.
Note
This review was translated by Claude.
LGTM! The code quality is good, with no issues in security or structure. The only area for improvement is error handling, but this is not a critical issue.
Original Content
LGTM! 代码质量良好,安全性和结构都没问题。唯一可改进的是错误处理,但这不是关键问题。
What this PR does
Before this PR:
There is no automated check to ensure PR authors fill in the required sections of the PR template. PRs can be submitted with empty or default-only descriptions.
After this PR:
A GitHub Actions workflow automatically validates that PR descriptions include actual content in the required sections (
What this PR does,Why we need it,release-note). It also reminds authors to review their description when new commits are pushed.Fixes #
Why we need it and why it was done in this way
The PR template exists to maintain quality and consistency in contributions, but without automated enforcement, authors may forget or skip filling it in. This workflow provides immediate feedback via check status and comments.
The implementation uses
actions/github-script@v7with inline JavaScript to keep everything in a single file without external dependencies. HTML comment markers (<!-- pr-description-check -->,<!-- pr-sync-reminder -->) are used to track and update bot comments, avoiding duplicate noise.The following tradeoffs were made:
The following alternatives were considered:
Breaking changes
N/A
Special notes for your reviewer
opened,edited,synchronize, andready_for_reviewevents for branchesmain,develop, andv2, matching the existingci.ymlpattern.notify-syncjob only runs onsynchronizeevents and shows the latest 3 commit messages.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note