fix cs
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/**************************************************************
|
||||
/*
|
||||
* This will delete all comments that match a specific keyword
|
||||
* 1. Process all issues that match "NAG!":
|
||||
* 2. Delete any comments that body exactly match "NAG!"
|
||||
**************************************************************/
|
||||
*/
|
||||
|
||||
// load the config, create the connection and load the repo sepcified on the cmd line args
|
||||
// we will then have $client and $repo available
|
||||
require('setup.php');
|
||||
require 'setup.php';
|
||||
|
||||
// loop through the issues
|
||||
// we use getIssues() here rather than forIssues() (see https://git.jhodges.co.uk/jhodges/GiteaBot/issues/1)
|
||||
foreach($repo->getIssues(['q'=>'NAG!']) as $issue){
|
||||
// loop through the current issues comments
|
||||
foreach($issue->getComments() as $comment){
|
||||
// if the comment body matches
|
||||
if($comment->body=='NAG!'){
|
||||
// delete the commend
|
||||
$repo->deleteComment($comment);
|
||||
foreach ($repo->getIssues(['q' => 'NAG!']) as $issue) {
|
||||
// loop through the current issues comments
|
||||
foreach ($issue->getComments() as $comment) {
|
||||
// if the comment body matches
|
||||
if ('NAG!' == $comment->body) {
|
||||
// delete the commend
|
||||
$repo->deleteComment($comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user