mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-11 15:22:54 +02:00
Include PR template in policy comment
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
const fs = require("node:fs");
|
||||||
|
|
||||||
const COMMENT_MARKER = "<!-- yaak-contribution-policy -->";
|
const COMMENT_MARKER = "<!-- yaak-contribution-policy -->";
|
||||||
|
|
||||||
const MAINTAINER_LOGINS = new Set(["gschier"]);
|
const MAINTAINER_LOGINS = new Set(["gschier"]);
|
||||||
@@ -280,6 +282,22 @@ function buildBlockingComment(analysis) {
|
|||||||
...analysis.blockers.map((blocker) => `- ${blocker.message}`),
|
...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.",
|
||||||
|
"",
|
||||||
|
"<details>",
|
||||||
|
"<summary>PR description template</summary>",
|
||||||
|
"",
|
||||||
|
"```md",
|
||||||
|
getPullRequestTemplate(),
|
||||||
|
"```",
|
||||||
|
"",
|
||||||
|
"</details>",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (analysis.largeDiff) {
|
if (analysis.largeDiff) {
|
||||||
lines.push(
|
lines.push(
|
||||||
"",
|
"",
|
||||||
@@ -295,6 +313,10 @@ function buildBlockingComment(analysis) {
|
|||||||
return lines.join("\n");
|
return lines.join("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPullRequestTemplate() {
|
||||||
|
return fs.readFileSync(".github/pull_request_template.md", "utf8").trim();
|
||||||
|
}
|
||||||
|
|
||||||
function buildInScopeComment() {
|
function buildInScopeComment() {
|
||||||
return [
|
return [
|
||||||
COMMENT_MARKER,
|
COMMENT_MARKER,
|
||||||
|
|||||||
Reference in New Issue
Block a user