fix cs
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/**************************************************
|
||||
/*
|
||||
* this will process all issues titled "delete me":
|
||||
* 1. remove all labels
|
||||
* 2. close the issue
|
||||
* 3. change the title to "deleted"
|
||||
**************************************************/
|
||||
*/
|
||||
|
||||
// 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 all matching issues
|
||||
// we use getIssues() here rather than forIssues() (see https://git.jhodges.co.uk/jhodges/GiteaBot/issues/1)
|
||||
foreach($repo->getIssues(['q'=>'delete me']) as $issue){
|
||||
// check for exact match
|
||||
if($issue->title=='delete me'){
|
||||
// remove all labels
|
||||
foreach($issue->labels as $label){
|
||||
$issue->removeLabel($label);
|
||||
foreach ($repo->getIssues(['q' => 'delete me']) as $issue) {
|
||||
// check for exact match
|
||||
if ('delete me' == $issue->title) {
|
||||
// remove all labels
|
||||
foreach ($issue->labels as $label) {
|
||||
$issue->removeLabel($label);
|
||||
}
|
||||
//change status and title.
|
||||
$issue->state = 'closed';
|
||||
$issue->title = 'deleted';
|
||||
$issue->save();
|
||||
}
|
||||
//change status and title.
|
||||
$issue->state='closed';
|
||||
$issue->title='deleted';
|
||||
$issue->save();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user