Module: Github
- Included in:
- Danger::DangerWCC
- Defined in:
- lib/wcc/github.rb
Instance Method Summary collapse
Instance Method Details
#add_labels(*new_labels) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/wcc/github.rb', line 17 def add_labels(*new_labels) existing = labels.map(&:name) new_labels.reject { |l| existing.include?(l) }.each do |to_create| github.api.add_label(repo_name, to_create) end github.api.add_labels_to_an_issue(repo_name, pr_number, new_labels) end |
#labels ⇒ Object
4 5 6 7 |
# File 'lib/wcc/github.rb', line 4 def labels @github_labels ||= github.api.labels(repo_name) end |
#pr_number ⇒ Object
13 14 15 |
# File 'lib/wcc/github.rb', line 13 def pr_number github.pr_json['number'] end |
#repo_name ⇒ Object
9 10 11 |
# File 'lib/wcc/github.rb', line 9 def repo_name github.pr_json['base']['repo']['full_name'] end |