Update bypass label handling in PR template check

This commit is contained in:
William Harrison authored and GitHub committed 2026-08-19 12:55:25 +08:00
1 parent 1e13e008ee
commit 43ad213be8
1 file changed
+3 -3
+3 -3
View File
@@ -5,10 +5,10 @@ const authorUsername = process.env.PR_AUTHOR || "";
const authorId = Number(process.env.PR_AUTHOR_ID);
const labels = JSON.parse(process.env.PR_LABELS || "[]");
const BYPASS_LABEL = "ci: bypass-template-check";
const BYPASS_LABELS = ["ci: bypass-template-check", "maintainer"];
const isTrustedUser = trustedUsers.some((u) => u.id === authorId);
const hasBypassLabel = labels.includes(BYPASS_LABEL);
const hasBypassLabel = labels.some((l) => BYPASS_LABELS.includes(l));
if (isTrustedUser) {
console.log(`PR author "${authorUsername}" is a trusted user. Skipping template validation.`);
@@ -16,7 +16,7 @@ if (isTrustedUser) {
}
if (hasBypassLabel) {
console.log(`PR has the "${BYPASS_LABEL}" label. Skipping template validation.`);
console.log(`PR has a label which bypasses this check. Skipping template validation.`);
process.exit(0);
}