npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-github-adapter

v0.10.0

Published

Hipchat adapter for Github. Talk to your Hubot from issue and pull request comments.

Downloads

6

Readme

hubot-github-adapter

A Hubot adapter to use with Github.

Use this adapter to have Hubot listen and comment on Github issues and pull requests.

Motivation

We use pull requests a lot. Now that we have a Hubot listening to our Pull Request chatter, we can do things like:

  • Ask hubot to merge our target branch back into our feature branch
  • Ask hubot to rebuild our branch (if it failed for a transient reason)
  • Get a picture of a cool squirrel when we say "ship it"

So, basically all the cool stuff that Hubot already does, but in the context of Github comments.

Getting Started

Creating a new bot

Follow the Hubot instructions to create a new bot.

####Install this adapter:

  • cd /path/to/hubot
  • yo hubot
  • npm install hubot-github-adapter --save
  • Initialize git and make your initial commit

####Create a Github User for your bot:

This is the user your Hubot will use to post comments.

  1. Sign up for a new account on Github
  2. If you have private repositories that your bot will be interacting with, add your bot as a collaborator to all of the repositories you want it to listen and respond to. You can skip this step for public repos.
  3. Create a new OAuth token for this Github User. It needs the following scopes:
  • repo (If you want it to create comments on private repos it has access to)
  • public_repo (so that it can create comments on public repos)

(Keep this token as secret as you would a password.)

####Create a Github Webhook for your each of your repositories: You'll need to create a Github webhook for every repository you want Hubot to listen to.

  1. Create a new webhook for your myuser/myrepo repository at: https://github.com/myuser/myrepo/settings/hooks/new Set the webhook url to: <HUBOT_URL>:<PORT>/hubot/github-repo-listener

    For example, if your hubot lives at myhubot.herokuapp.com, then you will set the webhook URL to: http://myhubot.herokuapp.com/hubot/github-repo-listener

    All of your repositories will point to the same URL.

####Configure your Hubot

Set the HUBOT_GITHUB_TOKEN environment variable to the token you created above.

Let's say you gave your Hubot user the name "BestHubotEver" You'll want to start your hubot with that name:

  • HUBOT_GITHUB_TOKEN=some-long-guid-number ./bin/hubot --adapter github-adapter --name BestHubotEver

####Test Your Hubot

Hubot is now listening to your comments on issues and pull requests. You should be able to say: @BestHubotEver ping, and if he is listening, he will respond with PONG

Testing your bot locally

If you want to test your bot locally, you can create a temporary webhook that goes to your machine instead of a live Hubot. See detailed instructions on the hubot-github-webhook-listener page.

Configuration

This adapter uses the following environment variables:

  • HUBOT_GITHUB_TOKEN - This is the auth token for the Github user you created above.

A note on naming

It's customary to name adapters simply hubot-<adapter>, however github-hubot is taken.

Copyright

Copyright © YouNeedABudget.com, LLC. (Github: YNAB)

Author

Taylor Brown, aka Taytay

License

MIT License; see LICENSE for further details.