Last active
January 11, 2022 15:27
Revisions
-
tylerpearson renamed this gist
Oct 11, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
tylerpearson revised this gist
Oct 11, 2014 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,10 @@ require 'octokit' # https://help.github.com/articles/creating-an-access-token-for-command-line-use/ client = Octokit::Client.new(:access_token => "getmefromgithub") COPY_FROM_REPO = "repo/old" COPY_TO_REPO = "repo/new" current_labels = client.labels(COPY_FROM_REPO) -
tylerpearson revised this gist
Oct 11, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,9 @@ current_labels = client.labels(COPY_FROM_REPO) current_labels.each do |label| begin client.add_label(COPY_TO_REPO, label.name, label.color) puts "Added #{label.name} - ##{label.color}" rescue Exception => e puts "#{label.name} already exists" if e.class == Octokit::UnprocessableEntity end -
tylerpearson created this gist
Oct 11, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ require 'octokit' client = Octokit::Client.new(:access_token => "getmefromgithub") COPY_FROM_REPO = "repo/start" COPY_TO_REPO = "repo/end" current_labels = client.labels(COPY_FROM_REPO) current_labels.each do |label| puts "Adding #{label.name} - ##{label.color}" begin client.add_label(COPY_TO_REPO, label.name, label.color) rescue Exception => e puts "#{label.name} already exists" if e.class == Octokit::UnprocessableEntity end end