circleci-bundle-update-pr 2.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +14 -34
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +56 -35
- data/README.md +2 -2
- data/bin/circleci-bundle-update-pr +1 -1
- data/circleci-bundle-update-pr.gemspec +4 -1
- data/lib/circleci/bundle/update/pr/version.rb +1 -1
- data/lib/circleci/bundle/update/pr.rb +17 -17
- data/spec/circleci/bundle/update/pr/note_spec.rb +4 -4
- data/spec/circleci/bundle/update/pr_spec.rb +1 -1
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f9f0c4b26b2b4a94afa593263ba9a79b97b9aa53e726a2eebb58c0d2d700385
|
4
|
+
data.tar.gz: 5b5c133b453d52d259097d3f7fe84e99fd138dfd1f5ed559b19232c83e4b5e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5253486a6aedf168f70ca1cf31bd91700ab02fd9a045ce3b4e1992a63407c4063da12de5952d75c8df744cc67c666ab698eafeb09bcc170b6aacabda60ccbbf
|
7
|
+
data.tar.gz: 2e3d2f9c61c0b0f75223d7cf9ca4d4b01d90693a856c7e75f9973be754082720b1bd84db9a9f81a41ffcceb7fc6656e66de68a9efc96c29e95efd89e414d7ec2
|
data/.circleci/config.yml
CHANGED
@@ -1,34 +1,21 @@
|
|
1
1
|
version: 2.1
|
2
2
|
|
3
3
|
orbs:
|
4
|
-
pushover: masutaka/pushover@
|
4
|
+
pushover: masutaka/pushover@2
|
5
5
|
|
6
6
|
executors:
|
7
7
|
default:
|
8
8
|
parameters:
|
9
9
|
ruby_version:
|
10
10
|
type: enum
|
11
|
-
enum: ['2.
|
11
|
+
enum: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
12
12
|
docker:
|
13
13
|
- image: cimg/ruby:<< parameters.ruby_version >>
|
14
14
|
working_directory: ~/repo
|
15
15
|
|
16
16
|
commands:
|
17
|
-
notify_on_failure_on_default_branch:
|
18
|
-
steps:
|
19
|
-
- pushover/notify-on-failure:
|
20
|
-
title: "Failed: ${CIRCLE_PROJECT_REPONAME}'s job (${CIRCLE_JOB})"
|
21
|
-
message: "failed ${CIRCLE_USERNAME:Bot}'s build (#${CIRCLE_BUILD_NUM}) in ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} (${CIRCLE_BRANCH})"
|
22
|
-
priority: 1 # high
|
23
|
-
only_for_branches: master
|
24
17
|
setup_requirements:
|
25
18
|
steps:
|
26
|
-
- run:
|
27
|
-
name: Install System Dependencies
|
28
|
-
command: |
|
29
|
-
# for cimg/ruby:2.4
|
30
|
-
sudo apt update -q
|
31
|
-
sudo apt install -q tzdata
|
32
19
|
- run:
|
33
20
|
name: Set timezone to Asia/Tokyo
|
34
21
|
command: sudo cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
|
@@ -36,7 +23,7 @@ commands:
|
|
36
23
|
parameters:
|
37
24
|
ruby_version:
|
38
25
|
type: enum
|
39
|
-
enum: ['2.
|
26
|
+
enum: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
40
27
|
steps:
|
41
28
|
- restore_cache:
|
42
29
|
name: Restore bundle cache
|
@@ -47,25 +34,20 @@ commands:
|
|
47
34
|
parameters:
|
48
35
|
ruby_version:
|
49
36
|
type: enum
|
50
|
-
enum: ['2.
|
37
|
+
enum: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
51
38
|
steps:
|
52
39
|
- save_cache:
|
53
40
|
name: Save bundle cache
|
54
41
|
key: gems-ruby<< parameters.ruby_version >>-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "Gemfile.lock" }}
|
55
42
|
paths:
|
56
43
|
- ~/repo/vendor/bundle
|
57
|
-
install_bundler:
|
58
|
-
steps:
|
59
|
-
- run:
|
60
|
-
name: install bundler
|
61
|
-
command: gem install -N bundler:1.17.3 # same version as Gemfile.lock
|
62
44
|
|
63
45
|
jobs:
|
64
46
|
build:
|
65
47
|
parameters:
|
66
48
|
ruby_version:
|
67
49
|
type: enum
|
68
|
-
enum: ['2.
|
50
|
+
enum: ['2.5', '2.6', '2.7', '3.0', '3.1']
|
69
51
|
executor:
|
70
52
|
name: default
|
71
53
|
ruby_version: << parameters.ruby_version >>
|
@@ -74,7 +56,6 @@ jobs:
|
|
74
56
|
- checkout
|
75
57
|
- restore_bundle_cache:
|
76
58
|
ruby_version: << parameters.ruby_version >>
|
77
|
-
- install_bundler
|
78
59
|
- run:
|
79
60
|
name: bundle install
|
80
61
|
command: |
|
@@ -84,17 +65,16 @@ jobs:
|
|
84
65
|
ruby_version: << parameters.ruby_version >>
|
85
66
|
- run: bundle exec rubocop
|
86
67
|
- run: bundle exec rspec
|
87
|
-
-
|
68
|
+
- pushover/notify-on-failure
|
88
69
|
continuous_bundle_update:
|
89
70
|
executor:
|
90
71
|
name: default
|
91
|
-
ruby_version: '3.
|
72
|
+
ruby_version: '3.1'
|
92
73
|
steps:
|
93
74
|
- setup_requirements
|
94
75
|
- checkout
|
95
76
|
- restore_bundle_cache:
|
96
|
-
ruby_version: '3.
|
97
|
-
- install_bundler
|
77
|
+
ruby_version: '3.1'
|
98
78
|
- run:
|
99
79
|
name: Install edge circleci-bundle-update-pr
|
100
80
|
command: |
|
@@ -102,16 +82,13 @@ jobs:
|
|
102
82
|
gem specific_install https://github.com/masutaka/circleci-bundle-update-pr.git
|
103
83
|
- deploy:
|
104
84
|
name: Run circleci-bundle-update-pr
|
105
|
-
command: circleci-bundle-update-pr CircleCI circleci@example.com $CIRCLE_BRANCH
|
106
|
-
-
|
85
|
+
command: circleci-bundle-update-pr CircleCI circleci@example.com $CIRCLE_BRANCH -d
|
86
|
+
- pushover/notify-on-failure
|
107
87
|
|
108
88
|
workflows:
|
109
89
|
version: 2
|
110
90
|
ordinary:
|
111
91
|
jobs:
|
112
|
-
- build:
|
113
|
-
name: ruby-2.4
|
114
|
-
ruby_version: '2.4'
|
115
92
|
- build:
|
116
93
|
name: ruby-2.5
|
117
94
|
ruby_version: '2.5'
|
@@ -124,10 +101,13 @@ workflows:
|
|
124
101
|
- build:
|
125
102
|
name: ruby-3.0
|
126
103
|
ruby_version: '3.0'
|
104
|
+
- build:
|
105
|
+
name: ruby-3.1
|
106
|
+
ruby_version: '3.1'
|
127
107
|
nightly:
|
128
108
|
triggers:
|
129
109
|
- schedule:
|
130
|
-
cron: "00 10 * *
|
110
|
+
cron: "00 10 1 * *"
|
131
111
|
filters:
|
132
112
|
branches:
|
133
113
|
only: master
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,71 +1,90 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
circleci-bundle-update-pr (
|
4
|
+
circleci-bundle-update-pr (3.1.0)
|
5
5
|
compare_linker (>= 1.4.0)
|
6
6
|
octokit
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.
|
11
|
+
addressable (2.8.0)
|
12
12
|
public_suffix (>= 2.0.2, < 5.0)
|
13
|
-
ast (2.4.
|
13
|
+
ast (2.4.2)
|
14
14
|
compare_linker (1.4.4)
|
15
15
|
httpclient
|
16
16
|
octokit
|
17
|
-
diff-lcs (1.
|
18
|
-
faraday (1.
|
17
|
+
diff-lcs (1.5.0)
|
18
|
+
faraday (1.10.0)
|
19
|
+
faraday-em_http (~> 1.0)
|
20
|
+
faraday-em_synchrony (~> 1.0)
|
21
|
+
faraday-excon (~> 1.1)
|
22
|
+
faraday-httpclient (~> 1.0)
|
23
|
+
faraday-multipart (~> 1.0)
|
19
24
|
faraday-net_http (~> 1.0)
|
25
|
+
faraday-net_http_persistent (~> 1.0)
|
26
|
+
faraday-patron (~> 1.0)
|
27
|
+
faraday-rack (~> 1.0)
|
28
|
+
faraday-retry (~> 1.0)
|
29
|
+
ruby2_keywords (>= 0.0.4)
|
30
|
+
faraday-em_http (1.0.0)
|
31
|
+
faraday-em_synchrony (1.0.0)
|
32
|
+
faraday-excon (1.1.0)
|
33
|
+
faraday-httpclient (1.0.1)
|
34
|
+
faraday-multipart (1.0.3)
|
20
35
|
multipart-post (>= 1.2, < 3)
|
21
|
-
|
22
|
-
faraday-
|
36
|
+
faraday-net_http (1.0.1)
|
37
|
+
faraday-net_http_persistent (1.2.0)
|
38
|
+
faraday-patron (1.0.0)
|
39
|
+
faraday-rack (1.0.0)
|
40
|
+
faraday-retry (1.0.3)
|
23
41
|
httpclient (2.8.3)
|
24
42
|
multipart-post (2.1.1)
|
25
|
-
octokit (4.
|
43
|
+
octokit (4.22.0)
|
26
44
|
faraday (>= 0.9)
|
27
45
|
sawyer (~> 0.8.0, >= 0.5.3)
|
28
46
|
parallel (1.19.2)
|
29
|
-
parser (3.
|
47
|
+
parser (3.1.2.0)
|
30
48
|
ast (~> 2.4.1)
|
31
|
-
public_suffix (4.0.
|
32
|
-
rainbow (3.
|
33
|
-
rake (13.0.
|
34
|
-
regexp_parser (2.
|
35
|
-
rexml (3.2.
|
36
|
-
rspec (3.
|
37
|
-
rspec-core (~> 3.
|
38
|
-
rspec-expectations (~> 3.
|
39
|
-
rspec-mocks (~> 3.
|
40
|
-
rspec-core (3.
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-expectations (3.
|
49
|
+
public_suffix (4.0.7)
|
50
|
+
rainbow (3.1.1)
|
51
|
+
rake (13.0.6)
|
52
|
+
regexp_parser (2.3.1)
|
53
|
+
rexml (3.2.5)
|
54
|
+
rspec (3.11.0)
|
55
|
+
rspec-core (~> 3.11.0)
|
56
|
+
rspec-expectations (~> 3.11.0)
|
57
|
+
rspec-mocks (~> 3.11.0)
|
58
|
+
rspec-core (3.11.0)
|
59
|
+
rspec-support (~> 3.11.0)
|
60
|
+
rspec-expectations (3.11.0)
|
43
61
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-mocks (3.
|
62
|
+
rspec-support (~> 3.11.0)
|
63
|
+
rspec-mocks (3.11.1)
|
46
64
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
-
rspec-support (~> 3.
|
48
|
-
rspec-support (3.
|
49
|
-
rubocop (1.
|
65
|
+
rspec-support (~> 3.11.0)
|
66
|
+
rspec-support (3.11.0)
|
67
|
+
rubocop (1.28.2)
|
50
68
|
parallel (~> 1.10)
|
51
|
-
parser (>= 3.
|
69
|
+
parser (>= 3.1.0.0)
|
52
70
|
rainbow (>= 2.2.2, < 4.0)
|
53
71
|
regexp_parser (>= 1.8, < 3.0)
|
54
72
|
rexml
|
55
|
-
rubocop-ast (>= 1.
|
73
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
56
74
|
ruby-progressbar (~> 1.7)
|
57
75
|
unicode-display_width (>= 1.4.0, < 3.0)
|
58
|
-
rubocop-ast (1.
|
59
|
-
parser (>=
|
60
|
-
rubocop-
|
76
|
+
rubocop-ast (1.17.0)
|
77
|
+
parser (>= 3.1.1.0)
|
78
|
+
rubocop-rake (0.6.0)
|
61
79
|
rubocop (~> 1.0)
|
62
|
-
|
80
|
+
rubocop-rspec (2.10.0)
|
81
|
+
rubocop (~> 1.19)
|
63
82
|
ruby-progressbar (1.11.0)
|
64
|
-
ruby2_keywords (0.0.
|
83
|
+
ruby2_keywords (0.0.5)
|
65
84
|
sawyer (0.8.2)
|
66
85
|
addressable (>= 2.3.5)
|
67
86
|
faraday (> 0.8, < 2.0)
|
68
|
-
unicode-display_width (2.
|
87
|
+
unicode-display_width (2.1.0)
|
69
88
|
|
70
89
|
PLATFORMS
|
71
90
|
ruby
|
@@ -73,6 +92,7 @@ PLATFORMS
|
|
73
92
|
x86_64-darwin-17
|
74
93
|
x86_64-darwin-18
|
75
94
|
x86_64-darwin-19
|
95
|
+
x86_64-linux
|
76
96
|
|
77
97
|
DEPENDENCIES
|
78
98
|
bundler
|
@@ -81,7 +101,8 @@ DEPENDENCIES
|
|
81
101
|
rake
|
82
102
|
rspec
|
83
103
|
rubocop
|
104
|
+
rubocop-rake
|
84
105
|
rubocop-rspec
|
85
106
|
|
86
107
|
BUNDLED WITH
|
87
|
-
|
108
|
+
2.3.11
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ jobs:
|
|
46
46
|
# snip
|
47
47
|
continuous_bundle_update:
|
48
48
|
docker:
|
49
|
-
- image: ruby:
|
49
|
+
- image: ruby:3.0.1-alpine
|
50
50
|
working_directory: /work
|
51
51
|
steps:
|
52
52
|
- run:
|
@@ -101,7 +101,7 @@ General usage:
|
|
101
101
|
$ circleci-bundle-update-pr <git username> <git email address>
|
102
102
|
```
|
103
103
|
|
104
|
-
By default, it works only on master
|
104
|
+
By default, it works only on master or main branches, but you can also explicitly specify any branches rather than only these branches by adding them to the arguments.
|
105
105
|
|
106
106
|
```
|
107
107
|
$ circleci-bundle-update-pr <git username> <git email address> master develop topic
|
@@ -15,7 +15,7 @@ opt.parse!(ARGV)
|
|
15
15
|
Circleci::Bundle::Update::Pr.create_if_needed(
|
16
16
|
git_username: ARGV.shift,
|
17
17
|
git_email: ARGV.shift,
|
18
|
-
git_branches: ARGV.empty? ? [
|
18
|
+
git_branches: ARGV.empty? ? %w[master main] : ARGV,
|
19
19
|
assignees: options[:assignees],
|
20
20
|
reviewers: options[:reviewers],
|
21
21
|
labels: options[:labels],
|
@@ -14,12 +14,14 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/masutaka/circleci-bundle-update-pr'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
18
|
+
|
17
19
|
spec.files = `git ls-files -z`.split("\x0")
|
18
20
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
21
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
22
|
spec.require_paths = ['lib']
|
21
23
|
|
22
|
-
spec.required_ruby_version = '>= 2.
|
24
|
+
spec.required_ruby_version = '>= 2.5.0'
|
23
25
|
|
24
26
|
spec.add_dependency 'compare_linker', '>= 1.4.0'
|
25
27
|
spec.add_dependency 'octokit'
|
@@ -29,5 +31,6 @@ Gem::Specification.new do |spec|
|
|
29
31
|
spec.add_development_dependency 'rake'
|
30
32
|
spec.add_development_dependency 'rspec'
|
31
33
|
spec.add_development_dependency 'rubocop'
|
34
|
+
spec.add_development_dependency 'rubocop-rake'
|
32
35
|
spec.add_development_dependency 'rubocop-rspec'
|
33
36
|
end
|
@@ -7,7 +7,7 @@ module Circleci
|
|
7
7
|
module Bundle
|
8
8
|
module Update
|
9
9
|
module Pr
|
10
|
-
def self.create_if_needed(git_username: nil, git_email: nil, git_branches: [
|
10
|
+
def self.create_if_needed(git_username: nil, git_email: nil, git_branches: %w[master main],
|
11
11
|
assignees: nil, reviewers: nil, labels: nil, allow_dup_pr: false)
|
12
12
|
raise_if_env_unvalid!
|
13
13
|
|
@@ -16,8 +16,8 @@ module Circleci
|
|
16
16
|
return
|
17
17
|
end
|
18
18
|
|
19
|
-
unless target_branch?(running_branch: ENV
|
20
|
-
puts "Skip because CIRCLE_BRANCH[#{ENV
|
19
|
+
unless target_branch?(running_branch: ENV.fetch('CIRCLE_BRANCH', nil), target_branches: git_branches)
|
20
|
+
puts "Skip because CIRCLE_BRANCH[#{ENV.fetch('CIRCLE_BRANCH', nil)}] is not included in target branches[#{git_branches.join(',')}]."
|
21
21
|
return
|
22
22
|
end
|
23
23
|
|
@@ -37,17 +37,17 @@ module Circleci
|
|
37
37
|
request_review(pull_request[:number], reviewers) if reviewers
|
38
38
|
end
|
39
39
|
|
40
|
-
BRANCH_PREFIX = ENV
|
41
|
-
TITLE_PREFIX = ENV
|
40
|
+
BRANCH_PREFIX = ENV.fetch('BRANCH_PREFIX', nil) || 'bundle-update-'.freeze
|
41
|
+
TITLE_PREFIX = ENV.fetch('TITLE_PREFIX', nil) || 'bundle update at '.freeze
|
42
42
|
|
43
43
|
def self.raise_if_env_unvalid!
|
44
44
|
raise "$CIRCLE_PROJECT_USERNAME isn't set" unless ENV['CIRCLE_PROJECT_USERNAME']
|
45
45
|
raise "$CIRCLE_PROJECT_REPONAME isn't set" unless ENV['CIRCLE_PROJECT_REPONAME']
|
46
46
|
raise "$GITHUB_ACCESS_TOKEN isn't set" unless ENV['GITHUB_ACCESS_TOKEN']
|
47
|
-
if ENV
|
47
|
+
if ENV.fetch('ENTERPRISE_OCTOKIT_ACCESS_TOKEN', nil) && !ENV['ENTERPRISE_OCTOKIT_API_ENDPOINT']
|
48
48
|
raise "$ENTERPRISE_OCTOKIT_API_ENDPOINT isn't set"
|
49
49
|
end
|
50
|
-
if !ENV['ENTERPRISE_OCTOKIT_ACCESS_TOKEN'] && ENV
|
50
|
+
if !ENV['ENTERPRISE_OCTOKIT_ACCESS_TOKEN'] && ENV.fetch('ENTERPRISE_OCTOKIT_API_ENDPOINT', nil)
|
51
51
|
raise "$ENTERPRISE_OCTOKIT_ACCESS_TOKEN isn't set"
|
52
52
|
end
|
53
53
|
end
|
@@ -106,7 +106,7 @@ module Circleci
|
|
106
106
|
def self.create_branch(git_username, git_email)
|
107
107
|
branch = "#{BRANCH_PREFIX}#{now.strftime('%Y%m%d%H%M%S')}"
|
108
108
|
|
109
|
-
current_ref = client.ref(repo_full_name, "heads/#{ENV
|
109
|
+
current_ref = client.ref(repo_full_name, "heads/#{ENV.fetch('CIRCLE_BRANCH', nil)}")
|
110
110
|
branch_ref = client.create_ref(repo_full_name, "heads/#{branch}", current_ref.object.sha)
|
111
111
|
|
112
112
|
branch_commit = client.commit(repo_full_name, branch_ref.object.sha)
|
@@ -151,7 +151,7 @@ module Circleci
|
|
151
151
|
# @return [Sawyer::Resource] The newly created pull request
|
152
152
|
def self.create_pull_request(branch)
|
153
153
|
title = "#{TITLE_PREFIX}#{now.strftime('%Y-%m-%d %H:%M:%S %Z')}"
|
154
|
-
client.create_pull_request(repo_full_name, ENV
|
154
|
+
client.create_pull_request(repo_full_name, ENV.fetch('CIRCLE_BRANCH', nil), branch, title)
|
155
155
|
end
|
156
156
|
private_class_method :create_pull_request
|
157
157
|
|
@@ -161,7 +161,7 @@ module Circleci
|
|
161
161
|
private_class_method :add_labels
|
162
162
|
|
163
163
|
def self.update_pull_request_body(pr_number)
|
164
|
-
ENV['OCTOKIT_ACCESS_TOKEN'] = ENV
|
164
|
+
ENV['OCTOKIT_ACCESS_TOKEN'] = ENV.fetch('GITHUB_ACCESS_TOKEN', nil)
|
165
165
|
compare_linker = CompareLinker.new(repo_full_name, pr_number)
|
166
166
|
compare_linker.formatter = CompareLinker::Formatter::Markdown.new
|
167
167
|
|
@@ -198,10 +198,10 @@ Powered by [circleci-bundle-update-pr](https://rubygems.org/gems/circleci-bundle
|
|
198
198
|
|
199
199
|
def self.client
|
200
200
|
if enterprise?
|
201
|
-
Octokit::Client.new(access_token: ENV
|
202
|
-
api_endpoint: ENV
|
201
|
+
Octokit::Client.new(access_token: ENV.fetch('ENTERPRISE_OCTOKIT_ACCESS_TOKEN', nil),
|
202
|
+
api_endpoint: ENV.fetch('ENTERPRISE_OCTOKIT_API_ENDPOINT', nil))
|
203
203
|
else
|
204
|
-
Octokit::Client.new(access_token: ENV
|
204
|
+
Octokit::Client.new(access_token: ENV.fetch('GITHUB_ACCESS_TOKEN', nil))
|
205
205
|
end
|
206
206
|
end
|
207
207
|
private_class_method :client
|
@@ -215,15 +215,15 @@ Powered by [circleci-bundle-update-pr](https://rubygems.org/gems/circleci-bundle
|
|
215
215
|
#
|
216
216
|
# @return [String] e.g. 'masutaka/circleci-bundle-update-pr'
|
217
217
|
def self.repo_full_name
|
218
|
-
@repo_full_name ||= "#{ENV
|
218
|
+
@repo_full_name ||= "#{ENV.fetch('CIRCLE_PROJECT_USERNAME', nil)}/#{ENV.fetch('CIRCLE_PROJECT_REPONAME', nil)}"
|
219
219
|
end
|
220
220
|
private_class_method :repo_full_name
|
221
221
|
|
222
222
|
def self.github_host
|
223
223
|
# A format like https://github.com/masutaka/circleci-bundle-update-pr.git
|
224
|
-
return Regexp.last_match(1) if ENV
|
224
|
+
return Regexp.last_match(1) if ENV.fetch('CIRCLE_REPOSITORY_URL', nil) =~ %r{https://(.+?)/}
|
225
225
|
# A format like git@github.com:masutaka/compare_linker.git
|
226
|
-
return Regexp.last_match(1) if ENV
|
226
|
+
return Regexp.last_match(1) if ENV.fetch('CIRCLE_REPOSITORY_URL', nil) =~ /([^@]+?):/
|
227
227
|
|
228
228
|
'github.com'
|
229
229
|
end
|
@@ -241,7 +241,7 @@ Powered by [circleci-bundle-update-pr](https://rubygems.org/gems/circleci-bundle
|
|
241
241
|
#
|
242
242
|
# @return [String]
|
243
243
|
def self.lockfile_path
|
244
|
-
workdir_env = ENV
|
244
|
+
workdir_env = ENV.fetch('CIRCLE_WORKING_DIRECTORY', nil)
|
245
245
|
return 'Gemfile.lock' unless workdir_env
|
246
246
|
|
247
247
|
workdir = Pathname.new(workdir_env).expand_path
|
@@ -54,7 +54,7 @@ describe Circleci::Bundle::Update::Pr::Note do
|
|
54
54
|
|
55
55
|
context 'with .circleci/BUNDLE_UPDATE_NOTE.md' do
|
56
56
|
before do
|
57
|
-
File.
|
57
|
+
File.write('.circleci/BUNDLE_UPDATE_NOTE.md', 'I am .circleci/BUNDLE_UPDATE_NOTE.md')
|
58
58
|
end
|
59
59
|
|
60
60
|
it { is_expected.to eq 'I am .circleci/BUNDLE_UPDATE_NOTE.md' }
|
@@ -62,7 +62,7 @@ describe Circleci::Bundle::Update::Pr::Note do
|
|
62
62
|
|
63
63
|
context 'with CIRCLECI_BUNDLE_UPDATE_NOTE.md' do
|
64
64
|
before do
|
65
|
-
File.
|
65
|
+
File.write('CIRCLECI_BUNDLE_UPDATE_NOTE.md', 'I am CIRCLECI_BUNDLE_UPDATE_NOTE.md')
|
66
66
|
end
|
67
67
|
|
68
68
|
it { is_expected.to eq 'I am CIRCLECI_BUNDLE_UPDATE_NOTE.md' }
|
@@ -70,8 +70,8 @@ describe Circleci::Bundle::Update::Pr::Note do
|
|
70
70
|
|
71
71
|
context 'with .circleci/BUNDLE_UPDATE_NOTE.md and CIRCLECI_BUNDLE_UPDATE_NOTE.md' do
|
72
72
|
before do
|
73
|
-
File.
|
74
|
-
File.
|
73
|
+
File.write('.circleci/BUNDLE_UPDATE_NOTE.md', 'I am .circleci/BUNDLE_UPDATE_NOTE.md')
|
74
|
+
File.write('CIRCLECI_BUNDLE_UPDATE_NOTE.md', 'I am CIRCLECI_BUNDLE_UPDATE_NOTE.md')
|
75
75
|
end
|
76
76
|
|
77
77
|
it { is_expected.to eq 'I am .circleci/BUNDLE_UPDATE_NOTE.md' }
|
@@ -77,7 +77,7 @@ describe Circleci::Bundle::Update::Pr do
|
|
77
77
|
context "when ENV['CIRCLE_WORKING_DIRECTORY'] is relative path" do
|
78
78
|
let(:workdir_env) do
|
79
79
|
project_dir = Pathname.getwd.to_s
|
80
|
-
home_dir = Pathname.new(ENV
|
80
|
+
home_dir = Pathname.new(ENV.fetch('HOME', nil)).to_s
|
81
81
|
project_dir.sub(home_dir, '~')
|
82
82
|
end
|
83
83
|
let(:src_dir) { 'spec/tmp' }
|
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:
|
4
|
+
version: 3.1.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:
|
11
|
+
date: 2022-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compare_linker
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rubocop-rspec
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +165,8 @@ files:
|
|
151
165
|
homepage: https://github.com/masutaka/circleci-bundle-update-pr
|
152
166
|
licenses:
|
153
167
|
- MIT
|
154
|
-
metadata:
|
168
|
+
metadata:
|
169
|
+
rubygems_mfa_required: 'true'
|
155
170
|
post_install_message:
|
156
171
|
rdoc_options: []
|
157
172
|
require_paths:
|
@@ -160,14 +175,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
175
|
requirements:
|
161
176
|
- - ">="
|
162
177
|
- !ruby/object:Gem::Version
|
163
|
-
version: 2.
|
178
|
+
version: 2.5.0
|
164
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
180
|
requirements:
|
166
181
|
- - ">="
|
167
182
|
- !ruby/object:Gem::Version
|
168
183
|
version: '0'
|
169
184
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
185
|
+
rubygems_version: 3.3.7
|
171
186
|
signing_key:
|
172
187
|
specification_version: 4
|
173
188
|
summary: Provide continues bundle update using CircleCI
|