mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 22:34:13 +00:00
danger: Use a regular message for notice about GitHub Issue links (#16287)
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
This commit is contained in:
parent
3c8d890702
commit
e10f2d8deb
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { danger, warn } from "danger";
|
import { danger, message, warn } from "danger";
|
||||||
const { prHygiene } = require("danger-plugin-pr-hygiene");
|
const { prHygiene } = require("danger-plugin-pr-hygiene");
|
||||||
|
|
||||||
prHygiene({
|
prHygiene({
|
||||||
|
@ -44,7 +44,7 @@ const ISSUE_LINK_PATTERN = new RegExp(
|
||||||
const includesIssueUrl = ISSUE_LINK_PATTERN.test(body);
|
const includesIssueUrl = ISSUE_LINK_PATTERN.test(body);
|
||||||
|
|
||||||
if (includesIssueUrl) {
|
if (includesIssueUrl) {
|
||||||
const matches = body.match(ISSUE_LINK_PATTERN);
|
const matches = body.match(ISSUE_LINK_PATTERN) ?? [];
|
||||||
const issues = matches
|
const issues = matches
|
||||||
.map((match) =>
|
.map((match) =>
|
||||||
match
|
match
|
||||||
|
@ -53,7 +53,7 @@ if (includesIssueUrl) {
|
||||||
)
|
)
|
||||||
.filter((issue, index, self) => self.indexOf(issue) === index);
|
.filter((issue, index, self) => self.indexOf(issue) === index);
|
||||||
|
|
||||||
warn(
|
message(
|
||||||
[
|
[
|
||||||
"This PR includes links to the following GitHub Issues: " +
|
"This PR includes links to the following GitHub Issues: " +
|
||||||
issues.map((issue) => `#${issue}`).join(", "),
|
issues.map((issue) => `#${issue}`).join(", "),
|
||||||
|
|
Loading…
Reference in a new issue