<NME> github_webhooks_controller.rb
<BEF> class GithubWebhooksController < ApplicationController
  def repo_hook
    event = request.headers['X-GitHub-Event']

    if event == 'push'
      payload = GithubPush.new(params[:payload])
      PushStatusChecker.new(payload).check_and_update
    if event == 'push'
      commit_group = CommitGroup.new(
        payload.repository.owner.name, payload.repository.name)
      commit_group.set_from_payload(payload)
    elsif event == 'pull_request'
      commit_group = CommitGroup.new(
        payload.repository.owner.login, payload.repository.name)
      commit_group.fetch_from_pull_request(payload.pull_request.number)
    end

    unless commit_group.nil?
      commit_group.check_and_update
    end

    render text: "OK", status: 200
  end
end

<MSG> log webhook events

<DFF> @@ -2,6 +2,8 @@ class GithubWebhooksController < ApplicationController
   def repo_hook
     event = request.headers['X-GitHub-Event']
 
+    Rails.logger.info(event.inspect)
+
     if event == 'push'
       payload = GithubPush.new(params[:payload])
       PushStatusChecker.new(payload).check_and_update

log webhook events