Created
October 10, 2016 20:17
-
-
Save Ceda/a2d8c1760e0a0f4003292d387f6eb142 to your computer and use it in GitHub Desktop.
Set repo labels
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 characters
require 'octokit' | |
Octokit.configure do |c| | |
c.login = '' | |
c.password = '' | |
end | |
new_labels = [ | |
{ name: 'Blocked', color: 'b60205' }, | |
{ name: 'Bug', color: 'd93f0b' }, | |
{ name: 'No QA', color: 'f9d0c4' }, | |
{ name: 'QA Done', color: 'fef2c0' }, | |
{ name: 'Ready for QA', color: 'fbca04' }, | |
{ name: 'Ready for Code Review', color: '1d76db' }, | |
{ name: 'Review Done', color: 'c5def5' }, | |
{ name: 'Tiny', color: 'd4c5f9' }, | |
{ name: 'WIP', color: 'c2e0c6' }, | |
{ name: 'Need FIX', color: 'e99695' }, | |
{ name: 'On Production', color: '0e8a16' } | |
] | |
repo = 'org/repo' | |
Octokit.labels(repo).each do |label| | |
Octokit.delete_label!(repo, label.name) | |
end | |
new_labels.each do |label| | |
Octokit.add_label repo, label[:name], label[:color] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment