Git Product home page Git Product logo

hubot-github-notify's Introduction

hubot-github-notify

NPM version Apache License Build Status NPM downloads

Hubot script to notify users of GitHub comment mentions, issues/PRs assignments.

Quick Start

Install hubot-github-notify as a npm dependency:

npm install hubot-github-notify --save

Then, edit your hubot's external-scripts.json and add hubot-github-notify to the array.

Configuration

For every repository you want hubot-github-notify to track you'll have to set up a Webhook in the form of <HUBOT_URL>:<PORT>/hubot/gh-notify and with the following events enabled: issues, issue_comments, pull_request.

You can configure some (optional) environment variables:

  • HUBOT_GITHUB_USER to provide a default GitHub username (or organization) if you want to let your users specify the name of the repositories only. They will still be able to specify a fully qualified path in the form of user/repo.
  • HUBOT_GITHUB_USER_SOMENAME to map chat usernames to GitHub user logins.

It is also strongly advised to make sure your hubot's brain implementation is up and working (the default one is redis-brain).

Username Mapping

If you don't want to use environment variables to map your users, you can rely on the github-credentials.coffee scripts, available in the default hubot-scripts package. Each user can therefore map their own username against a GitHub user:

fra> hubot i am frapontillo
hubot> Ok, you are frapontillo on GitHub

Users can also check their mapping:

fra> hubot who am i
hubot> fra: You are known as frapontillo on GitHub

hubot-github-notify will honor these credentials before the ones in the environment variables; if no mapping is eventually found, an error is shown to the user.

Usage

Notify to mentions/assignments

You can get notified of mentions by telling hubot something like:

user> hubot notify me of mentions in some_user/some_repo
hubot> You will now receive notifications for mentions in some_user/some_repo.

Please note that:

  • to get notified of assignments, replace mentions with assignments
  • you can omit the some_user/ username part, provided you specified the HUBOT_GITHUB_USER among the environment variables
  • you can omit the whole in some_user/some_repo, and you'll be notified for every repository that has a Webhook to the current hubot session; every other mention or assignment notification setting will be deleted and overridden by this one
  • me and of are optional, they're there for the sake of English language

Un-notify from mentions/assignments

To unsubscribe from mentions or assignments, go with:

user> hubot unnotify me from mentions in some_user/some_repo
hubot> You will no longer receive notifications for mentions in some_user/some_repo.

Here as well, please note that:

  • to unsubscribe from assignments, replace mentions with assignments
  • you can omit the some_user/ username part, provided you specified the HUBOT_GITHUB_USER among the environment variables
  • you can omit the whole in some_user/some_repo, and you'll remove every subscription you previously registered
  • me and from are optional

List mentions/assignments notifications

You can ask your hubot what notifications are active:

user> hubot list my mentions notifications
hubot> You will receive notifications for mentions in some_user/some_repo.

The same patterns as before apply here: you can replace mentions with assignments and my is optional.

Directory Structure

hubot-github-notify uses the common directory structure for hubot script packages.

script

This directory is home to development scripts: bootstrap and test are used to bootstrap the development environment and run tests respectively.

src

This directory is home to the actual hubot scripts in the package. The index.coffee entry point will load the scripts from this directory.

test

This directory is home to all the tests for the scripts. Tests use Mocha, Chai and Sinon.

Contributing

When reporting issues, please provide a full example of both configuration and execution.

Pull requests are most welcome, remember to always submit them against the develop branch.

License

   Copyright 2014 Francesco Pontillo

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

hubot-github-notify's People

Contributors

frapontillo avatar jacobaweiss avatar justinmchase avatar stevefranks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hubot-github-notify's Issues

Notification on New Comment in Participating Issue or Pull Request

Feature request:

Right now hubot-github-notify sends notifications in these situations:

  • An issue or pull request is assigned to that person
  • A comment is posted anywhere with an @mention of that person

However, we'd also like to receive a notification when a comment is added to an issue or pull request that I'm "interested" in. Trivially, this would be a notification for any issue or pull request that is assigned to me. Optimally, this would be a notification for any issue or pull request where I'm listed as a participant (It's an opt in/out list in the right-hand column of each issue on GitHub).

Does not detect group mentions

Currently this plugin works if someone is mentioned directly as an individual, but will not detect team mentions. This is a pain, as I know a few people (Including myself) who are using this to manage their GitHub notifications and as a result are missing a portion of their mentions.

๐Ÿ‘ Please fix โค๏ธ

(thank you in for such a great plugin)

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.