add "@bot quiet" to suppress repeat warnings

This commit is contained in:
James 2020-04-04 11:10:29 +01:00
parent e2e428b28c
commit c309f2b225

View File

@ -69,14 +69,24 @@ final class PostFailedTests{
// get any existing issue
$issue=$this->repo->getIssues(['q' => $name])[0]??null;
// are there any instructions in comments?
$quiet=false;
foreach($issue->getComments() as $comment){
if( stripos('@bot quiet',$comment->body)!==false ){
$quiet=true;
}
}
// if existing issue, is the error the same?
if($issue){
if( $this->doesMessageMatch($issue->body,$message,$att) ){
if($quiet){return;}
$issue->addComment("Failed again. Same errors as [above]($issue->html_url#issue-{$issue->id})");
return;
}else{
foreach($issue->getComments() as $comment){
if( $this->doesMessageMatch($comment->body,$message,$att) ){
if($quiet){return;}
$issue->addComment("Failed again. Same errors as [above]($issue->html_url#issuecomment-{$comment->id})");
return;
}