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,