Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,15 @@ Closes #<!-- issue number -->

-

## Test Plan
## Verification

<!-- How was this tested? Include both automated and manual verification steps. -->

### Automated

- [ ] `cargo test --workspace` passes
- [ ] No new clippy warnings

### Manual (optional)

<!-- Step-by-step instructions for a reviewer to manually verify the change. Delete this section if not applicable. -->
<!-- How was this PR validated? Pick what applies:
- Code: `cargo test --workspace` passes, no new clippy warnings, new/updated tests for the change.
- Release: CI green on the version bump + changelog roll; no code changes.
- Docs / CI / chore: how you checked the result (rendered output, workflow run, dry-run, etc.).
Include manual verification steps for a reviewer where they add signal. -->

## Checklist

- [ ] Linked to an issue
- [ ] CHANGELOG.md updated under `[Unreleased]`
- [ ] CHANGELOG.md updated (entry under `[Unreleased]` — or `[Unreleased]` rolled into a version section for a release PR; not applicable to docs/CI-only changes)
Comment thread
joshuajbouw marked this conversation as resolved.
28 changes: 21 additions & 7 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,34 @@ jobs:
ERRORS=""

# Check required sections exist and have content beyond the template placeholder
section_content() {
# Extract text between this section header and the next ## header.
# The closing header is removed by pattern (not `$d`) so a section that
# happens to be the last one in the body keeps its final content line.
echo "$PR_BODY" | sed -n "/^## $1/,/^## /p" | sed '1d' | sed '/^## /d' | sed '/^<!--.*-->$/d' | sed '/^\s*$/d'
}

check_section() {
local section="$1"
local content
# Extract text between this section header and the next ## header
content=$(echo "$PR_BODY" | sed -n "/^## $section/,/^## /p" | sed '1d;$d' | sed '/^<!--.*-->$/d' | sed '/^\s*$/d')
if [ -z "$content" ]; then
ERRORS="${ERRORS}Missing or empty section: ## $section\n"
if [ -z "$(section_content "$1")" ]; then
ERRORS="${ERRORS}Missing or empty section: ## $1\n"
fi
}

# Accept any one of the named sections (e.g. the current name and a legacy alias)
check_section_any() {
local section
for section in "$@"; do
if [ -n "$(section_content "$section")" ]; then
return 0
fi
done
ERRORS="${ERRORS}Missing or empty section: ## $1 (or: $(printf '## %s ' "${@:2}"))\n"
}

check_section "Linked Issue"
check_section "Summary"
check_section "Changes"
check_section "Test Plan"
check_section_any "Verification" "Test Plan"

# Check that Linked Issue has an actual issue number, not just the placeholder
if ! echo "$PR_BODY" | grep -qE '#[0-9]+'; then
Expand Down
Loading