forked from jhodges/GiteaBot-examples

This commit is contained in:
James
2019-09-14 12:31:25 +01:00
commit 3403c1a148
13 changed files with 399 additions and 0 deletions

27
src/delete_labels.php Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/php
<?php
/****************************************************
* This will loop through a list of label names
* If the label exists on the repo, delete the label
****************************************************/
// 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');
//define the repeat terms
$names=[
'janurary','feburary','march','april','may','june','july','august','september','october','november','december',
'monday','tuesday','wednesday','thursday','friday','saturday','sunday',
'daily','weekly','fortnightly','monthly','yearly'
];
//loop through the names
foreach($names as $name){
//see if label exists?
$label=$repo->getLabelByName($name);
if($label){ //it exists
//delete it
$repo->deleteLabel($label);
}
}