add "@bot quiet" to suppress repeat warnings
This commit is contained in:
parent
e2e428b28c
commit
c309f2b225
@ -69,14 +69,24 @@ final class PostFailedTests{
|
|||||||
// get any existing issue
|
// get any existing issue
|
||||||
$issue=$this->repo->getIssues(['q' => $name])[0]??null;
|
$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 existing issue, is the error the same?
|
||||||
if($issue){
|
if($issue){
|
||||||
if( $this->doesMessageMatch($issue->body,$message,$att) ){
|
if( $this->doesMessageMatch($issue->body,$message,$att) ){
|
||||||
|
if($quiet){return;}
|
||||||
$issue->addComment("Failed again. Same errors as [above]($issue->html_url#issue-{$issue->id})");
|
$issue->addComment("Failed again. Same errors as [above]($issue->html_url#issue-{$issue->id})");
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
foreach($issue->getComments() as $comment){
|
foreach($issue->getComments() as $comment){
|
||||||
if( $this->doesMessageMatch($comment->body,$message,$att) ){
|
if( $this->doesMessageMatch($comment->body,$message,$att) ){
|
||||||
|
if($quiet){return;}
|
||||||
$issue->addComment("Failed again. Same errors as [above]($issue->html_url#issuecomment-{$comment->id})");
|
$issue->addComment("Failed again. Same errors as [above]($issue->html_url#issuecomment-{$comment->id})");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user