@@ -698,15 +698,18 @@ if File.file?(failsafe_report)
698698 end
699699end
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 )
706709end
707710
708711commits = 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
723726end
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
738741end
739742
740743all_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