Skip to content

ci: add PR description check workflow#13035

Merged
DeJeune merged 3 commits intomainfrom
ci/pr-description-check
Feb 25, 2026
Merged

ci: add PR description check workflow#13035
DeJeune merged 3 commits intomainfrom
ci/pr-description-check

Conversation

@DeJeune
Copy link
Copy Markdown
Collaborator

@DeJeune DeJeune commented Feb 25, 2026

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@v7 with 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:

  • Inline script vs. external action: chose inline to minimize maintenance overhead and keep the logic visible in one place.

The following alternatives were considered:

  • A dedicated GitHub App or external action for template checking — rejected as overkill for this scope.

Breaking changes

N/A

Special notes for your reviewer

  • The workflow runs on opened, edited, synchronize, and ready_for_review events for branches main, develop, and v2, matching the existing ci.yml pattern.
  • Draft PRs are skipped.
  • The notify-sync job only runs on synchronize events 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

NONE

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]>
Copy link
Copy Markdown
Collaborator

@EurFelux EurFelux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 25, 2026

⚠️ New commits pushed

Please review your PR description to ensure it still accurately reflects the changes.

Latest commits:

  • f055230 fix(ci): use github.paginate for reliable latest commits fetching
  • 67f35db fix(ci): handle pagination in PR commit listing
  • 4ddb95f ci: add PR description check workflow

@DeJeune DeJeune requested a review from EurFelux February 25, 2026 05:55
Copy link
Copy Markdown
Collaborator

@EurFelux EurFelux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
Copy link
Copy Markdown
Collaborator

@EurFelux EurFelux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@GeorgeDong32 GeorgeDong32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 代码质量良好,安全性和结构都没问题。唯一可改进的是错误处理,但这不是关键问题。

@DeJeune DeJeune merged commit 6fa53a7 into main Feb 25, 2026
14 checks passed
@DeJeune DeJeune deleted the ci/pr-description-check branch February 25, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants