From 64504569077adeec0b84ba3facdce70657ff47ab Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Wed, 19 Aug 2020 11:33:37 +0200 Subject: [PATCH 1/2] meta(danger): Don't comment when changelogs are present --- dangerfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dangerfile.js b/dangerfile.js index 8274d6d4a0..998c22e159 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -19,9 +19,9 @@ If none of the above apply, you can opt out by adding _#skip-changelog_ to the P const skipChangelog = danger.github && (danger.github.pr.body + "").includes("#skip-changelog"); -if (!hasChangelog && !hasPyChangelog && !skipChangelog) { +if (skipChangelog) { + message("Opted out of changelogs due to #skip-changelog."); +} else if (!hasChangelog && !hasPyChangelog) { fail(ERROR_MESSAGE); markdown(DETAILS); -} else { - message("Opted out of changelogs due to #skip-changelog."); } From 8fcdc62d480113500353e0e33104930d2146668b Mon Sep 17 00:00:00 2001 From: Jan Michael Auer Date: Wed, 19 Aug 2020 11:39:44 +0200 Subject: [PATCH 2/2] ref(danger): Only comment on failure --- dangerfile.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dangerfile.js b/dangerfile.js index 998c22e159..2fe302b85e 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -19,9 +19,7 @@ If none of the above apply, you can opt out by adding _#skip-changelog_ to the P const skipChangelog = danger.github && (danger.github.pr.body + "").includes("#skip-changelog"); -if (skipChangelog) { - message("Opted out of changelogs due to #skip-changelog."); -} else if (!hasChangelog && !hasPyChangelog) { +if (!skipChangelog && !hasChangelog && !hasPyChangelog) { fail(ERROR_MESSAGE); markdown(DETAILS); }