circleci-bundle-update-pr 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README-for-CircleCI-1.0.md +6 -0
- data/README.md +6 -0
- data/bin/circleci-bundle-update-pr +12 -1
- data/lib/circleci/bundle/update/pr.rb +7 -1
- 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: 810482472816d5a97508a3427b3c62ef710ef073a045537a109578fe5f42e03f
|
4
|
+
data.tar.gz: 500887eca1eac3aafa52596c61ad1e6e432c6d99030b38903762609e34b54b51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c38298e4625d5bd50a9eae298ad118a3424ee7268ad242fac66518cded716a1c9d45ae98e2ba5dc12a2b6a20f6edc7c676dfad9ac9d383b5f41503d1d5e14b5
|
7
|
+
data.tar.gz: 45e87d4710a167a0495368b3939247c539be87d7f69852fc230ecb1e20bb147be7ef6d895f8e82d09a2c73ca297adef7db698e073dc8418aa31d0293a6a2128a
|
data/Gemfile.lock
CHANGED
data/README-for-CircleCI-1.0.md
CHANGED
@@ -102,6 +102,12 @@ By default, it works only on master branch, but you can also explicitly specify
|
|
102
102
|
$ circleci-bundle-update-pr <git username> <git email address> master develop topic
|
103
103
|
```
|
104
104
|
|
105
|
+
You can assign the PR to any users.
|
106
|
+
|
107
|
+
```
|
108
|
+
$ circleci-bundle-update-pr <git username> <git email address> -a alice,bob,carol
|
109
|
+
```
|
110
|
+
|
105
111
|
## Contributing
|
106
112
|
|
107
113
|
1. Fork it ( https://github.com/masutaka/circleci-bundle-update-pr/fork )
|
data/README.md
CHANGED
@@ -109,6 +109,12 @@ By default, it works only on master branch, but you can also explicitly specify
|
|
109
109
|
$ circleci-bundle-update-pr <git username> <git email address> master develop topic
|
110
110
|
```
|
111
111
|
|
112
|
+
You can assign the PR to any users.
|
113
|
+
|
114
|
+
```
|
115
|
+
$ circleci-bundle-update-pr <git username> <git email address> -a alice,bob,carol
|
116
|
+
```
|
117
|
+
|
112
118
|
## Contributing
|
113
119
|
|
114
120
|
1. Fork it ( https://github.com/masutaka/circleci-bundle-update-pr/fork )
|
@@ -1,5 +1,16 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "circleci/bundle/update/pr"
|
4
|
+
require 'optparse'
|
4
5
|
|
5
|
-
|
6
|
+
opt = OptionParser.new
|
7
|
+
options = { assignees: [] }
|
8
|
+
opt.on('-a', '--assignees alice,bob,carol', Array, 'Assign the PR to them') { |v| options[:assignees] = v }
|
9
|
+
opt.parse!(ARGV)
|
10
|
+
|
11
|
+
Circleci::Bundle::Update::Pr.create_if_needed(
|
12
|
+
git_username: ARGV.shift,
|
13
|
+
git_email: ARGV.shift,
|
14
|
+
git_branches: ARGV.empty? ? ["master"] : ARGV,
|
15
|
+
assignees: options[:assignees],
|
16
|
+
)
|
@@ -6,7 +6,7 @@ module Circleci
|
|
6
6
|
module Bundle
|
7
7
|
module Update
|
8
8
|
module Pr
|
9
|
-
def self.create_if_needed(git_username: nil, git_email: nil, git_branches: ["master"])
|
9
|
+
def self.create_if_needed(git_username: nil, git_email: nil, git_branches: ["master"], assignees: [])
|
10
10
|
raise_if_env_unvalid!
|
11
11
|
return unless need?(git_branches)
|
12
12
|
repo_full_name = "#{ENV['CIRCLE_PROJECT_USERNAME']}/#{ENV['CIRCLE_PROJECT_REPONAME']}"
|
@@ -19,6 +19,7 @@ module Circleci
|
|
19
19
|
create_branch(git_username, git_email, branch, repo_full_name)
|
20
20
|
pull_request = create_pull_request(repo_full_name, branch, now)
|
21
21
|
add_comment_of_compare_linker(repo_full_name, pull_request[:number])
|
22
|
+
add_assignees(repo_full_name, pull_request[:number], assignees) unless assignees.empty?
|
22
23
|
end
|
23
24
|
|
24
25
|
def self.need?(git_branches)
|
@@ -66,6 +67,11 @@ Powered by [compare_linker](https://rubygems.org/gems/compare_linker)
|
|
66
67
|
end
|
67
68
|
private_class_method :add_comment_of_compare_linker
|
68
69
|
|
70
|
+
def self.add_assignees(repo_full_name, pr_number, assignees)
|
71
|
+
client.add_assignees(repo_full_name, pr_number, assignees)
|
72
|
+
end
|
73
|
+
private_class_method :add_assignees
|
74
|
+
|
69
75
|
def self.client
|
70
76
|
if enterprise?
|
71
77
|
Octokit::Client.new(access_token: ENV['ENTERPRISE_OCTOKIT_ACCESS_TOKEN'],
|
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.10.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-06-
|
11
|
+
date: 2018-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|