bug: null error on new issue

This commit is contained in:
James 2020-05-03 09:18:42 +01:00
parent 9b2546c3ee
commit 96ef72c71c

View File

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