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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Dangerfile +7 -4
- data/lib/netsoft-danger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca4dcd0963df60b652e45e3bba8ef8262b350e52c0f659b5ec6660cf6f107ffa
|
4
|
+
data.tar.gz: 351f00d2d1f090c7a97e4385adc5c40af0284055b9d5a7676bdb1aec2bc99588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a29a7f5ffc53604bbbde1214b6ff006b7ead9d38cfee18fc843b2f5d8df467e1c77ed8e914895bc0e0a7e0eebb85808f5d5b5f1a23500c850c9738723ec5b4c
|
7
|
+
data.tar.gz: c7ceb9f06a2815b36ae58e540197aaa7866daa3168c741dcc4ea862eb52b3496612593e9c5ff3e7ea1791be89dc99cac995d66f1f401c4243bdcf30f27e48300
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
|