From c50aa53f1ae73a6117df6860887637f1706e44cf Mon Sep 17 00:00:00 2001 From: Hans-Peter Lehmann Date: Tue, 6 Jan 2026 10:36:28 +0100 Subject: [PATCH] Check description position in PR check (#8209) --- .github/workflows/pr-conventions.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-conventions.yml b/.github/workflows/pr-conventions.yml index 984bbf30d..5403de09c 100644 --- a/.github/workflows/pr-conventions.yml +++ b/.github/workflows/pr-conventions.yml @@ -16,10 +16,21 @@ jobs: const issueRegex = /#\d+/i; if (issueRegex.test(context.payload.pull_request.title)) { core.setFailed("Please mention the issue number in the PR description, not in the title. Make sure to write 'closes #'."); + return; } - const closingRegex = /\b(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved):?\s+#\d+/i; + const closingRegex = /\b(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved|contributes to):?\s+#\d+/i; if (issueRegex.test(context.payload.pull_request.body) && !closingRegex.test(context.payload.pull_request.body)) { core.setFailed("The PR description must contain 'closes #' to link to the issue that it closes."); return; } + + const bodyLines = (context.payload.pull_request.body || "").split(/\r?\n/); + const checklistIndex = bodyLines.map(l => l.includes("https://antennapod.org")).lastIndexOf(true); + if (checklistIndex === -1) { + core.setFailed("It looks like you did not follow the PR template. The checklist from the template is missing or incomplete."); + return; + } else if (bodyLines.length - checklistIndex - 1 > 5) { + core.setFailed("It looks like you did not follow the PR template. Please add your description above the checklist, not below."); + return; + }