Sinatra Github webhook extension, for handling github webhook payloads.
This gem has not reached a releasable state yet. Stay tuned!
Add this line to your application's Gemfile:
gem 'sinatra-github'And then execute:
$ bundle
Or install it yourself as:
$ gem install sinatra-github
Register the extension in your sinatra application, then use the new "github" DSL method. For example:
require 'sinatra/base'
require 'sinatra/github'
class MyApp < Sinatra::Base
# Matches github commit comments.
# Payload is available as parsed JSON, via the "payload" method.
# https://developer.github.com/v3/activity/events/types/#commitcommentevent
github :commit_comment, '/webhook'
puts payload['comment']['url']
end
end- Fork it ( https://github.com/[my-github-username]/sinatra-github/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request