Add configurable PR template section validation - #136
Merged
Conversation
Introduces a new `validate-pr-template-sections` input that accepts a multiline list of section heading names to require non-empty content under. Heading level is ignored so any `#`-level heading matches. Content consisting only of blockquote lines (placeholder examples) is treated as empty. Existing `validate-description`, `validate-changelog`, and `validate-credits` inputs are unchanged. Also updates the default `comment-template` wording to be generic rather than referencing 10up-specific section names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
Author
|
Note that this was crafted to help with cases where repos using this have drastically different PR templates (ex. WordPress/ai#765). |
There was a problem hiding this comment.
Pull request overview
Adds a configurable mechanism to validate that specific PR template sections are filled out, via a new validate-pr-template-sections action input, while keeping existing hardcoded validations intact.
Changes:
- Add
validate-pr-template-sectionsinput parsing and wire it into PR validation. - Introduce a
getSectionContent()helper to extract and evaluate content under an arbitrary heading. - Update default
comment-templatewording and document the new input in the README.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils.js | Adds multiline input parsing for required headings and introduces getSectionContent() for extracting section body text. |
| src/pr-validation.js | Runs per-section validation using the new input and helper, emitting a distinct error per missing section. |
| README.md | Documents the new input and provides usage guidance/examples. |
| action.yml | Declares the new validate-pr-template-sections input and updates the default comment template. |
| dist/index.js | Updates the bundled distribution output to include the new input/validation logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iamdharmesh
approved these changes
Jun 27, 2026
iamdharmesh
left a comment
Member
There was a problem hiding this comment.
Thanks a lot @jeffpaul. This looks great ![]()
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.
Description of the Change
Introduces a new
validate-pr-template-sectionsinput that accepts a multiline list of PR template section headings to require non-empty content under. This allows repositories with custom PR templates to validate that specific sections have been filled out, without being tied to the hardcodedDescription of the Change,Changelog, andCreditsheadings used by the existing validation inputs.Key behaviors:
What?,## Why?, and### Use of AI Toolsall match the same heading text> ...) is treated as empty, handling placeholder examples common in PR templatesvalidate-description,validate-changelog, andvalidate-creditsinputs are unchangedcomment-templatewording to be generic rather than referencing 10up-specific section namesChangelog
Added - New
validate-pr-template-sectionsinput for configurable PR template section validation.Credits
@jeffpaul