GithubHelp home page GithubHelp logo

kryndex / oss-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from firebase/oss-bot

0.0 2.0 0.0 104 KB

Robot friend for open source repositories

Home Page: https://ossbot.computer

License: Apache License 2.0

Python 8.86% JavaScript 85.01% HTML 4.24% Shell 1.89%

oss-bot's Introduction

oss-bot

Introduction

A robot to automate github issue/pull request management. This robot has the following features:

  • Ensure adherence to templates.
  • Automatically add labels based on custom configuration.
  • Automatically add 'feature-request' and 'needs-triage' labels to issues.
  • Send customized email notifications based on labels, allowing more granular subscriptions than Github provides.

Runs on Cloud Functions for Firebase using Github webhooks.

Deployment

Deploy Cronjob

First install dependencies:

cd appengine
gcloud components install app-engine-python
pip install -t lib -r requirements.txt

Set project ID (same as firebase project):

gcloud config set project <your-project-id>

Deploy an App Engine app:

gcloud app deploy app.yaml cron.yaml

Customize Configuration

Edit the config/config.json file to have configuration in the following form:

{
  "<ORG_NAME>": {
    "<REPO_NAME>": {
      "labels": {
        "<LABEL_NAME>": {
          "regex": "<ISSUE_BODY_REGEX>",
          "email": "<LABEL_NOTIFICATION_EMAIL>"
        }
      },
      "cleanup": {
        "pr": PR_EXPIRY_MS
      }
    }
  }
}

If the regex matches the issue body (anywhere) then an email will be sent to the email address.

Configure Secrets

Github:

Go to the github token page and create a new personal access token for the bot account with the following permissions:

  • public_repo - access public repositories.
  • admin:repo_hook - read and write repository hooks.
firebase functions:config:set github.token="<YOUR_GITHUB_TOKEN>"

Mailgun:

firebase functions:config:set mailgun.key="<YOUR_MAILGUN_KEY>"
firebase functions:config:set mailgun.domain="<YOUR_MAILGUN_DOMAIN>"

Configure Github Webhook

In Github add a webhook with the following configuration:

  • Payload URL - your cloud functions HTTP URL. Which should be https://<YOURPROJECT>.cloudfunctions.net/githubWebhook.
  • Content type - application/json
  • Secret - N/A
  • Select individual events:
    • Issues
    • Pull request
    • Issue comment

Development

Test

To run basic tests, use npm test which runs the mocha tests in smoketest.js. These tests are mostly a sanity check, used to verify basic behavior without needing an end-to-end deploy.

Formatting

Code is formatted using prettier so no bikeshedding allowed. Run npm run format before committing.

oss-bot's People

Contributors

samtstern avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.