An unoptionated bot driven by a configuration file in the repository.
Branch: master
Clone or download
sokra Merge pull request #9 from DominikGuzei/fix/missing-request-dependency
Add missing request dependency for open-bot package
Latest commit 8b8b8c3 Feb 21, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc add schedule action and add includeBotActions property to last_action… Aug 9, 2017
lib Merge pull request #9 from DominikGuzei/fix/missing-request-dependency Feb 21, 2018
scripts Initial commit Mar 30, 2017
.gitignore Initial commit Mar 30, 2017
README.md docs: Fix a typo and add a link to AWS CLI installations instructions Jun 29, 2017
handlers.js add schedule handler and table Aug 9, 2017
open-bot.js add cli helper Mar 30, 2017
open-bot.yaml add schedule handler and table Aug 9, 2017
package.json
serverless.yml
yarn.lock add missing request dependency for open-bot package Jan 22, 2018

README.md

open-bot

An unoptionated bot driven by a configuration file in the repository.

  • Operates on issue/PRs
  • Triggered by webhook event or manual batch processing (CLI)
  • Rules specify behavior
  • Runs on AWS with serverless

Configuration

  • Add the bot's webhook to the webhooks in the repo/org configuration (content type json, events: Issue comment, Issues, Pull request, Pull request review, Pull request review comment, Status)
  • Create a open-bot.yaml file in the repository root.
  • Add the bot name to the yaml file (bot property)
  • Add rules to the rules property (array) see Rules

How does it work?

It checks all filters to get the lastest date where the filter matches. If not all filters match it stops here.

For each action it checks if and when the action was already applied. If yes it compares action date if lastest filter date and breaks if action was applied after filter match. Elsewise it runs the action.

This means: It makes sure that actions runs once after filters match. If filters match again, actions run again.

Deploy your own bot

  • Clone the repo
  • Run yarn
  • Run node open-bot configurate and answer questions
  • Run yarn run deploy-prod to deploy the bot (takes a while)
  • Run node open-bot to gain access to the other tools, i. e. batch processing

Contributing

Add new filters or actions

  • Add a file in the folder
  • Edit the index.js file
  • Test it locally with node open-bot process some/repo#123 --settings open-bot.yaml --simulate
  • Send a PR

License

Free for open-source projects.

Get in contact with me if you want to use it for private repos.