Skip to content

Commit 1bd9abc

Browse files
committed
Added summary checker in runner
1 parent 0671bda commit 1bd9abc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/pr-format-check.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,17 @@ jobs:
3030
3131
if (!hasWorkItemLink) {
3232
core.setFailed(`❌ PR should contain a valid ADO Work Item ID.\nExpected a hyperlink in the format: https://sqlclientdrivers.visualstudio.com/.../_workitems/edit/<ID>\nPlease ensure the ADO task hyperlink is present in the PR description.`);
33+
}
34+
35+
// Check if PR description contains a non-empty summary section
36+
const summaryPattern = /###\s*Summary\s*\r?\n([\s\S]*?)(\r?\n###|$)/;
37+
const summaryMatch = body.match(summaryPattern);
38+
39+
// If summary section exists, check if it has content (excluding comments and whitespace)
40+
const hasSummary = summaryMatch &&
41+
summaryMatch[1] &&
42+
summaryMatch[1].replace(/<!--[\s\S]*?-->/g, '').trim().length > 0;
43+
44+
if (!hasSummary) {
45+
core.setFailed(`❌ PR should contain a non-empty summary section. Please add a meaningful summary under the '### Summary' heading in your PR description.`);
3346
}

0 commit comments

Comments
 (0)