Skip to content

Commit d5e0f52

Browse files
committed
Dangerfile: don't show some warnings/messages to dependabot.
No functional changes. [ci skip]
1 parent cbd3fcd commit d5e0f52

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Dangerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -698,15 +698,18 @@ if File.file?(failsafe_report)
698698
end
699699
end
700700

701-
if github.pr_body !~ /Addressed to #\d+/
701+
# Don't show some warnings/messages to a bot, it doesn't read them
702+
prFromRealUser = github.pr_author != 'dependabot'
703+
704+
if prFromRealUser && github.pr_body !~ /Addressed to #\d+/
702705
warn(
703706
"danger check: pull request description doesn't contain a link to original issue.\n"\
704707
"Consider adding a comment in the following format: `Addressed to #XXX` where `XXX` is an issue number"
705708
)
706709
end
707710

708711
commits = git.commits.size
709-
if commits > 1
712+
if prFromRealUser && commits > 1
710713
if git.commits.any? { |c| c.message =~ /^Merge branch/ || c.message =~ /^Merge remote-tracking branch/ }
711714
fail(
712715
"danger check: pull request contains merge commits! "\
@@ -722,7 +725,7 @@ if commits > 1
722725
end
723726
end
724727

725-
if github.branch_for_head !~ /^gh[0-9]+_/
728+
if prFromRealUser && github.branch_for_head !~ /^gh[0-9]+_/
726729
warn("danger check: branch `#{github.branch_for_head}` does not comply with our best practices. "\
727730
"Branch name should use the following scheme: `ghXXX_meaningful-name` where `XXX` is an issue number. "\
728731
"**Next time**, please, use this scheme :)"
@@ -738,7 +741,7 @@ if modified_resources && !updated_url
738741
end
739742

740743
all_checks_passed = violation_report[:errors].empty? && violation_report[:warnings].empty? && violation_report[:messages].empty?
741-
if all_checks_passed
744+
if prFromRealUser && all_checks_passed
742745
message(
743746
"@#{github.pr_author} thank you for the PR! All quality checks have been passed! "\
744747
"Next step is to wait when @php-coder will review this code"

0 commit comments

Comments
 (0)