fix description

This commit is contained in:
James 2019-09-05 17:37:06 +01:00
parent 32c31161ae
commit 918bc83d71
3 changed files with 23 additions and 9 deletions

View File

@ -1,5 +1,9 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
/******************
* close ALL issues
******************/
// load the config, create the connection and load the repo sepcified on the cmd line args // load the config, create the connection and load the repo sepcified on the cmd line args
// we will then have $client and $repo available // we will then have $client and $repo available
require('setup.php'); require('setup.php');

View File

@ -1,11 +1,11 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
/***** /***************************************************************************************************************
** 1a. Adds a no-milestone label to any issues with no milestone * 1. Adds a 'no-milestone' label to any issues with no milestone
** 1b. Also removes the label if present on an issue with a milestone * 2. Removes the 'no-milestone' label if present on an issue with a milestone
** 2a. Adds a no-label label to any issues with no labels (excluding the no-label and no-milestone) * 3. Adds a 'no-label' label to any issues with no labels (excluding 'no-label' and 'no-milestone')
** 2b. Also removes the label if present on an issue with a label (excluding the no-label and no-milestone) * 4. Removes the 'no-label' label if present on an issue with a label (excluding 'no-label' and 'no-milestone')
******/ ****************************************************************************************************************/
// load the config, create the connection and load the repo sepcified on the cmd line args // load the config, create the connection and load the repo sepcified on the cmd line args
// we will then have $client and $repo available // we will then have $client and $repo available
@ -37,5 +37,5 @@ $callback=function($issue) use ($nolabelLabel,$nomilestoneLabel){
} }
}; };
//loop through issues and call the callback //loop through all issues and call the callback
$repo->forIssues($callback); $repo->forIssues($callback);

View File

@ -1,5 +1,15 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
/***********************************************************************
* This is designed to allow the use of labels to reopen recuring issues
* on a specific day, month or duration (daily/weekly/monthly etc)
* NOTE: This is not 100% implemented/tested. It's a WIP
* It will process any issue that is tagged with 'xxx/repeat' label
* The labels are grouped into days/months
* If an issue is closed then it will be reopened
* If an issue is already open the bot will comment "NAG!" about it
***********************************************************************/
// load the config, create the connection and load the repo sepcified on the cmd line args // load the config, create the connection and load the repo sepcified on the cmd line args
// we will then have $client and $repo available // we will then have $client and $repo available
require('setup.php'); require('setup.php');
@ -14,6 +24,7 @@ $terms=[
/* create the labels */ /* create the labels */
foreach($terms as $group=>$names){ foreach($terms as $group=>$names){
foreach($names as $name){ foreach($names as $name){
$name="{$name}/repeat";
$label=$repo->getLabelByName($name); $label=$repo->getLabelByName($name);
if(!$label){ if(!$label){
$label=$repo->createLabel([ $label=$repo->createLabel([
@ -26,7 +37,6 @@ foreach($terms as $group=>$names){
} }
//define the function to process each issue //define the function to process each issue
$daily=function($issue){ $daily=function($issue){
$day_updated=date('d/m/Y',strtotime($issue->updated_at)); $day_updated=date('d/m/Y',strtotime($issue->updated_at));
$day_closed=date('d/m/Y',strtotime($issue->closed_at)); $day_closed=date('d/m/Y',strtotime($issue->closed_at));