circleci-bundle-update-pr 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/bin/circleci-bundle-update-pr +2 -0
- data/lib/circleci/bundle/update/pr.rb +14 -4
- data/lib/circleci/bundle/update/pr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 730944a68610db32ff05eed70a7679dd3eb435e6b70c5cd6a4e87a89635bbb45
|
4
|
+
data.tar.gz: e10e148aec42a589409f667a0a61acefc5d46025c4f78d1b608334d3eecabe55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81cca2a76b7348417a52bad36b610be96355cf0748ca5a8df095575dfd431b1ba6538bf8ac9c7c6ba38080a121f91dd3458268f0c607be3a484e8e170f3455ed
|
7
|
+
data.tar.gz: 587c1b13c5d72cab5c3fb5c11ddb2c18ece7f41c5767f8eeab5bbfc19a609c476b8b5e2718dc92db22914e551ae2989daacf86a90a5bf78d4eb46fec7df59511
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -115,6 +115,7 @@ Usage: circleci-bundle-update-pr [options]
|
|
115
115
|
-a, --assignees alice,bob,carol Assign the PR to them
|
116
116
|
-r, --reviewers alice,bob,carol Request PR review to them
|
117
117
|
-l, --labels "In Review, Update" Add labels to the PR
|
118
|
+
-d, --duplicate Make PR even if it has already existed
|
118
119
|
```
|
119
120
|
|
120
121
|
## Contributing
|
@@ -8,6 +8,7 @@ options = { assignees: [] }
|
|
8
8
|
opt.on('-a', '--assignees alice,bob,carol', Array, 'Assign the PR to them') { |v| options[:assignees] = v.map(&:strip) }
|
9
9
|
opt.on('-r', '--reviewers alice,bob,carol', Array, 'Request PR review to them') { |v| options[:reviewers] = v.map(&:strip) }
|
10
10
|
opt.on('-l', '--labels "In Review, Update"', Array, 'Add labels to the PR') { |v| options[:labels] = v.map(&:strip) }
|
11
|
+
opt.on('-d', '--duplicate', 'Make PR even if it has already existed') { |v| options[:allow_dup_pr] = v }
|
11
12
|
opt.parse!(ARGV)
|
12
13
|
|
13
14
|
Circleci::Bundle::Update::Pr.create_if_needed(
|
@@ -17,4 +18,5 @@ Circleci::Bundle::Update::Pr.create_if_needed(
|
|
17
18
|
assignees: options[:assignees],
|
18
19
|
reviewers: options[:reviewers],
|
19
20
|
labels: options[:labels],
|
21
|
+
allow_dup_pr: !!options[:allow_dup_pr]
|
20
22
|
)
|
@@ -7,10 +7,10 @@ module Circleci
|
|
7
7
|
module Update
|
8
8
|
module Pr
|
9
9
|
def self.create_if_needed(git_username: nil, git_email: nil, git_branches: ["master"],
|
10
|
-
assignees: nil, reviewers: nil, labels: nil)
|
10
|
+
assignees: nil, reviewers: nil, labels: nil, allow_dup_pr: false)
|
11
11
|
raise_if_env_unvalid!
|
12
12
|
|
13
|
-
if skip?
|
13
|
+
if skip?(allow_dup_pr)
|
14
14
|
puts 'Skip because it has already existed.'
|
15
15
|
return
|
16
16
|
end
|
@@ -47,15 +47,25 @@ module Circleci
|
|
47
47
|
end
|
48
48
|
private_class_method :raise_if_env_unvalid!
|
49
49
|
|
50
|
+
# Should skip to make PR?
|
51
|
+
#
|
52
|
+
# @param allow_dup_pr [Boolean]
|
53
|
+
# @return [Boolean]
|
54
|
+
def self.skip?(allow_dup_pr)
|
55
|
+
return false if allow_dup_pr
|
56
|
+
exists_bundle_update_pr?
|
57
|
+
end
|
58
|
+
private_class_method :skip?
|
59
|
+
|
50
60
|
# Has 'bundle update PR' already existed?
|
51
61
|
#
|
52
62
|
# @return [Boolean]
|
53
|
-
def self.
|
63
|
+
def self.exists_bundle_update_pr?
|
54
64
|
client.pull_requests(repo_full_name).find do |pr|
|
55
65
|
pr.title =~ /\A#{TITLE_PREFIX}/ && pr.head.ref =~ /\A#{BRANCH_PREFIX}\d+/
|
56
66
|
end != nil
|
57
67
|
end
|
58
|
-
private_class_method :
|
68
|
+
private_class_method :exists_bundle_update_pr?
|
59
69
|
|
60
70
|
# Does it need to commit due to bundle update?
|
61
71
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circleci-bundle-update-pr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Masuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|