Coder Social home page Coder Social logo

github_for_slack's Introduction

Rootstrap Github for Slack

Description

Send Github pull request notifications to Slack.

Initial project setup

  1. Clone this repo
  2. Install PostgreSQL in case you don't have it
  3. Create your database.yml and application.yml files. There are sample files in /config
  4. bundle install
  5. Generate a secret key with rake secret and paste this value into the application.yml.
  6. Fill the SLACK_API_TOKEN and SLACK_BOT_TOKEN in application.yml. To get the credentials: log in to https://api.slack.com/apps, select your application and then click OAuth Tokens & Redirect URLs. SLACK_API_TOKEN is the OAuth Access Token and SLACK_BOT_TOKEN is Bot User OAuth Access Token
  7. rake db:create
  8. rake db:migrate
  9. rake db:seed # this will create an admin with [email protected]:password
  10. npm install -g ngrok Install Ngrok
  11. rspec and make sure all tests pass
  12. rails s
  13. You are ready!

How to test the webhook locally?

  • Create a dummy repository in github with a couple branches.
  • Run server: rails s -p 3001
  • In another terminal run ngrok: ngrok http 3001
  • Copy ngrok url to github configuration page (settings->hooks) http://xxxxxxx.ngrok.io/api/v1/notifications_filter
  • Change CHANNEL in SlackNotificationService to your @name or #some_test_channel
  • Create/edit pull request adding or removing labels. This will execute the webhook.

Deploy to Heroku

Install heroku cli https://devcenter.heroku.com/articles/heroku-cli#download-and-install

  • Setup:
heroku login
enter credentials
heroku git:remote -a rootstrap-github-for-slack
  • Push:
git push heroku master

Docs and Backlog

Backlog

Acess the Trello board

Ngrok

Public URLs for exposing your local web server https://ngrok.com/

Github Hooks

Info about github hooks and Pull request payload

https://developer.github.com/webhooks/configuring/ https://developer.github.com/v3/activity/events/types/#pullrequestevent

Slack methods

https://api.slack.com/methods

github_for_slack's People

Contributors

matiasmansilla1989 avatar santiagovidal avatar vitogit avatar

Watchers

 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.