Skip to content

Instantly share code, notes, and snippets.

@Ceda
Created October 10, 2016 20:17
Show Gist options
  • Save Ceda/a2d8c1760e0a0f4003292d387f6eb142 to your computer and use it in GitHub Desktop.
Save Ceda/a2d8c1760e0a0f4003292d387f6eb142 to your computer and use it in GitHub Desktop.
Set repo labels
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