From bac4c300661622620ef1eab21b4b7772ec45c17f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9my=20Coutable?= <remy@rymai.me>
Date: Mon, 25 May 2020 18:32:48 +0200
Subject: [PATCH] Only post 'Retry' message if Danger says anything
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rémy Coutable <remy@rymai.me>
---
 Dangerfile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Dangerfile b/Dangerfile
index c428b55f33aa7..cc6ebc27d4e9c 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -15,4 +15,8 @@ gitlab_danger.rule_names.each do |file|
   danger.import_dangerfile(path: File.join('danger', file))
 end
 
-markdown("**If needed, you can retry the [`danger-review` job](#{ENV['CI_JOB_URL']}) that generated this comment.**") if gitlab_danger.ci?
+anything_to_post = status_report.values.any? { |data| data.any? }
+
+if gitlab_danger.ci? && anything_to_post
+  markdown("**If needed, you can retry the [`danger-review` job](#{ENV['CI_JOB_URL']}) that generated this comment.**")
+end
-- 
GitLab