lib/github_labeler.rb
#
# Create a single change for adding a label to a repo
#
Create a single change for adding a label to a repo
Create a single change for adding a label to a repo
def add_label_to_repo(repo, label, options = {})
    existing_label = @repo_labels[repo][label[:name].downcase]
    if existing_label
      if existing_label[:color] != label[:color] or existing_label[:name] != label[:name]
        @logger.warn "Label #{label[:name]} already exist, creating an update"
        return { :type => "update", :repo => repo, :label => label }
      end
    else
      return { :type => "add", :repo => repo, :label => label }
    end
    @logger.warn "Label #{label[:name]} already exist and is the same. No change created"
    return nil
  end
def add_label_to_repo ( repo , label , options = { } ) existing_label = @repo_labels [ repo ] [ label [ :name ] . downcase ] if existing_label if existing_label [ :color ] != label [ :color ] or existing_label [ :name ] != label [ :name ] @logger . warn "Label #{label[:name]} already exist, creating an update" return { :type => "update" , :repo => repo , :label => label } end else return { :type => "add" , :repo => repo , :label => label } end @logger . warn "Label #{label[:name]} already exist and is the same. No change created" return nil end
Create a single change for adding a label to a repo
Create a single change for adding a label to a repo
repo
label
options