netsoft-danger 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfb9db9333ed0616edd6d2650f3d39949842ab95f4226ba641d2829f041e3168
4
- data.tar.gz: faf45b8bf21ecea1afaf661651579c2b732155979ba15947ba26592f446794bf
3
+ metadata.gz: ca4dcd0963df60b652e45e3bba8ef8262b350e52c0f659b5ec6660cf6f107ffa
4
+ data.tar.gz: 351f00d2d1f090c7a97e4385adc5c40af0284055b9d5a7676bdb1aec2bc99588
5
5
  SHA512:
6
- metadata.gz: 503763af26af1a7ad5a88c9b76dd345f4b5de9384111be1aaee93bfb78b4f0f970ab77d98440ca87256f65aac2c3d7e105043ad11514edcfd86ec884ae816c1c
7
- data.tar.gz: f195d074cdc895ae1031fc326e90b6f718fef0f8e335cf15fd09e1341e4fd45ac652ca2e1343ee71fdee4e367ccde3e26a0b1df5493238b2757482a3dd6493aa
6
+ metadata.gz: 6a29a7f5ffc53604bbbde1214b6ff006b7ead9d38cfee18fc843b2f5d8df467e1c77ed8e914895bc0e0a7e0eebb85808f5d5b5f1a23500c850c9738723ec5b4c
7
+ data.tar.gz: c7ceb9f06a2815b36ae58e540197aaa7866daa3168c741dcc4ea862eb52b3496612593e9c5ff3e7ea1791be89dc99cac995d66f1f401c4243bdcf30f27e48300
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
9
  ### Changed
10
10
  ### Fixed
11
11
 
12
+ ## [0.3.9]
13
+ ### Fixed
14
+ - correct API call to github for adding labels and fix logic in determining if we should or should not add the label
15
+
12
16
  ## [0.3.8]
13
17
  ### Added
14
18
  - auto add/remove some labels
data/Dangerfile CHANGED
@@ -4,8 +4,9 @@ def toggle_label(github, label, should_set)
4
4
  repo_name = github.pr_json['head']['repo']['full_name']
5
5
  pr_number = github.pr_json['number']
6
6
  has_label = github.pr_labels.include?(label)
7
+ puts repo_name: repo_name, pr_number: pr_number, labels: github.pr_labels, has_label: has_label, label: label, should_set: should_set
7
8
  if should_set && !has_label
8
- github.api.add_labels_to_an_issue(repo_name, pr_number, label)
9
+ github.api.add_labels_to_an_issue(repo_name, pr_number, [label])
9
10
  elsif !should_set && has_label
10
11
  github.api.remove_label(repo_name, pr_number, label)
11
12
  end
@@ -36,6 +37,8 @@ if github.branch_for_head.start_with?('security')
36
37
  toggle_label(github, 'security', true)
37
38
  end
38
39
 
40
+ should_have_migration_label = false
41
+
39
42
  git.commits.each do |c|
40
43
  short = " ( #{c.sha[0..7]} )"
41
44
  has_migrations = c.diff_parent.any? { |f| f.path =~ %r{db/migrate/} }
@@ -60,11 +63,9 @@ git.commits.each do |c|
60
63
  fail 'migration: Migration commit contains non-migration changes' + short
61
64
  end
62
65
 
63
- toggle_label(github, 'run migration', true)
66
+ should_have_migration_label = true
64
67
  elsif has_migration_msg
65
68
  fail '[migration] Migration commit with no migrations!' + short
66
- else
67
- toggle_label(github, 'run migration', false)
68
69
  end
69
70
 
70
71
  has_hubstaff_icon_changes = c.diff_parent.any? { |f| f.path =~ /hubstaff(icons|font)|fontcustom-manifest/ }
@@ -114,6 +115,8 @@ git.commits.each do |c|
114
115
  end
115
116
  end
116
117
 
118
+ toggle_label(github, 'run migration', should_have_migration_label)
119
+
117
120
  if ENV['CIRCLE_TOKEN']
118
121
  require 'open-uri'
119
122
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NetsoftDanger
4
- VERSION = '0.3.8'
4
+ VERSION = '0.3.9'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsoft-danger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - urkle