From 80e56281b241064d6812a258905619078e42ee04 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Tue, 30 Jun 2026 14:45:44 -0700 Subject: [PATCH] Include PR template in policy comment --- .github/scripts/check-contribution-policy.js | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/scripts/check-contribution-policy.js b/.github/scripts/check-contribution-policy.js index 75aeda6b..22ede437 100644 --- a/.github/scripts/check-contribution-policy.js +++ b/.github/scripts/check-contribution-policy.js @@ -1,3 +1,5 @@ +const fs = require("node:fs"); + const COMMENT_MARKER = ""; const MAINTAINER_LOGINS = new Set(["gschier"]); @@ -280,6 +282,22 @@ function buildBlockingComment(analysis) { ...analysis.blockers.map((blocker) => `- ${blocker.message}`), ]; + if (!analysis.templateUsed) { + lines.push( + "", + "You can copy this template into the PR description and keep any existing context that is still useful.", + "", + "
", + "PR description template", + "", + "```md", + getPullRequestTemplate(), + "```", + "", + "
", + ); + } + if (analysis.largeDiff) { lines.push( "", @@ -295,6 +313,10 @@ function buildBlockingComment(analysis) { return lines.join("\n"); } +function getPullRequestTemplate() { + return fs.readFileSync(".github/pull_request_template.md", "utf8").trim(); +} + function buildInScopeComment() { return [ COMMENT_MARKER,