Sha256: 4822a9445fcf5aa628b8e2348de20ad4e437cc32ebd5fe2d4e0f92bea573dc0c

Contents?: true

Size: 716 Bytes

Versions: 3

Compression:

Stored size: 716 Bytes

Contents

require_dependency "overlay/application_controller"

module Overlay
  class GithubController < ApplicationController
    def update
      render nothing: true

      Overlay.configuration.repositories.each do |repo_config|
        next unless repo_config.class == GithubRepo
        branch = repo_config[:branch] || 'master'

        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'}"
            GithubJob.new.async.perform repo_config
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
overlay-1.0.7 app/controllers/overlay/github_controller.rb
overlay-1.0.6 app/controllers/overlay/github_controller.rb
overlay-1.0.5 app/controllers/overlay/github_controller.rb