Go to file
2019-11-10 15:10:06 +00:00
src better csv output 2019-11-10 15:10:06 +00:00
.gitignore init 2019-08-25 11:04:55 +01:00
composer.json update GiteaBot to stable v1.2 2019-09-05 17:19:23 +01:00
composer.lock update GiteaBot lib to 1.2.1 2019-09-07 09:50:53 +01:00
README.md Update 'README.md' 2019-09-14 12:34:00 +01:00

Examples for jhodges/GiteaBot

More advanced (incomplete) examples can be found at jhodges/GiteaBot-repeat

Install

  1. Clone or download and unpack this repo.
  2. Do a composer install
  3. Copy src/config.php.dist to src/config.php and set your Gitea instalce URL and bots user/pass.

Examples

All examples include src/setup.php which loads the autoloader and config, connects to the Gitea instance specified in config, passes the command line args, and opens the repo specified on command line. After this $client and $repo will be available.


###src/test.php

/************************************************
* Simple example to create a new label and issue
*************************************************/

###src/edit.php

/*******************************************************
* This will loop through all issues and add some custom
* text to the issue body. It will use a placeholder so
* that it can be automatically updated without replacing
* the whole issue body
********************************************************/

###src/delete_nags.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!"
**************************************************************/

###src/delete_labels.php

/****************************************************
* This will loop through a list of label names
* If the label exists on the repo, delete the label
****************************************************/

###src/delete_me.php

/**************************************************
* this will process all issues titled "delete me":
* 1. remove all labels
* 2. close the issue
* 3. change the title to "deleted"
**************************************************/

###src/no_label_milestone.php

/***************************************************************************************************************
* 1. Adds a 'no-milestone' label to any issues with no milestone
* 2. Removes the 'no-milestone' label if present on an issue with a milestone
* 3. Adds a 'no-label' label to any issues with no labels (excluding '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')
****************************************************************************************************************/

###src/close_all.php

/******************
* close ALL issues
******************/