app/controllers/overlay/github_controller.rb in overlay-1.1.0 vs app/controllers/overlay/github_controller.rb in overlay-2.0.0

- old
+ new

@@ -1,19 +1,16 @@ -require_dependency "overlay/application_controller" - module Overlay - class GithubController < ApplicationController + class GithubController < Overlay::ApplicationController def update render nothing: true Overlay.configuration.repositories.each do |repo_config| next unless repo_config.class == GithubRepo - branch = repo_config[:branch] || 'master' + branch = repo_config.branch if (params[:repository] && params[:ref]) - if (params[:repository][:name] == repo_config[:repo]) && (params[:ref] == "refs/heads/#{branch}") - logger.info "Enqueueing GithubJob for repo: #{repo_config[:repo]} and branch: #{repo_config[:branch] || 'master'}" - Overlay::Github.overlay_repo repo_config + if (params[:repository][:name] == repo_config.repo) && (params[:ref] == "refs/heads/#{branch}") + Overlay::Github.instance.process_hook(params, repo_config) end end end end end