From e10f2d8deb69ff60c9101d893669f3d6c8d2e3ff Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 15 Aug 2024 09:21:50 -0400 Subject: [PATCH] danger: Use a regular message for notice about GitHub Issue links (#16287) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR make it so Danger will use a regular message—as opposed to a warning—for notices about GitHub issue links. There are still some false-positives getting flagged, so showing a warning is a bit too aggressive. Release Notes: - N/A --- script/danger/dangerfile.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script/danger/dangerfile.ts b/script/danger/dangerfile.ts index d26b3c347b..db3a13822b 100644 --- a/script/danger/dangerfile.ts +++ b/script/danger/dangerfile.ts @@ -1,4 +1,4 @@ -import { danger, warn } from "danger"; +import { danger, message, warn } from "danger"; const { prHygiene } = require("danger-plugin-pr-hygiene"); prHygiene({ @@ -44,7 +44,7 @@ const ISSUE_LINK_PATTERN = new RegExp( const includesIssueUrl = ISSUE_LINK_PATTERN.test(body); if (includesIssueUrl) { - const matches = body.match(ISSUE_LINK_PATTERN); + const matches = body.match(ISSUE_LINK_PATTERN) ?? []; const issues = matches .map((match) => match @@ -53,7 +53,7 @@ if (includesIssueUrl) { ) .filter((issue, index, self) => self.indexOf(issue) === index); - warn( + message( [ "This PR includes links to the following GitHub Issues: " + issues.map((issue) => `#${issue}`).join(", "),