configure_trusted_publisher 0.1.7 → 0.1.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: 62e88e6f8fe2b2d276cb12750fa89c2197510a32c2c0f173f8d1fb0882c48195
4
- data.tar.gz: 1aca9105419c282a2e007f9d0289425bfddbdca0508a008d9142fddb79aa7072
3
+ metadata.gz: '069cf11b54abc980ac845968c09a93b3779aa4153ca6ae8c4e58093352fd5270'
4
+ data.tar.gz: 4da5f62636b14c6837fadb4847f27e3267b13797ba4e4c66a4e9bbbfe35adc48
5
5
  SHA512:
6
- metadata.gz: 593966c8a3b809875c88151be176f7e6c62feeb934f337cf1e54479668fd24dbc4e763fb3bb1eb579292b9f1b4e758fef4c9b9e3db8f59c9677446df9eca974a
7
- data.tar.gz: 9ea13772ac9bd771cdf766cdfed92e906aaf05498744172a225c055d5e71a1fd5b2f598ba86e4c5700b78c3c3b42c4d61aab8c1b29b3c52325dd3c0f797032f5
6
+ metadata.gz: 146c6c690a138f3c837aa7aee7fa39e25b9cbc08a30884a2441fcf796ca46e691814ca1c039d10e2ecc8fe4309b91aebd67152a95fc062e050cb41957f4fe9b9
7
+ data.tar.gz: 9aeff4f526331e46da39edba8bacc5eebfea0f6d2ab6b703195032dec8c0c4842ca34136a4cca35e995741864a12ad484a0e99781a941eb1c8ddb4d1f151c1f0
@@ -154,17 +154,18 @@ module ConfigureTrustedPublisher
154
154
  puts "Configuring trusted publisher for #{rubygem_name} in #{File.expand_path(repository)} for " \
155
155
  "#{github_repository.join('/')}"
156
156
 
157
- write_release_action(repository, rubygem_name, environment: add_environment)
157
+ environment = add_environment
158
+ write_release_action(repository, rubygem_name, environment:)
158
159
 
159
160
  gc = GemcutterUtilities.new(
160
161
  say: ->(msg) { puts msg },
161
162
  ask: lambda { |msg|
162
163
  puts
163
- ask msg.chomp(":")
164
+ ask msg.strip.chomp(":")
164
165
  },
165
166
  ask_for_password: lambda { |msg|
166
167
  puts
167
- ask_secret msg.chomp(":")
168
+ ask_secret msg.strip.chomp(":")
168
169
  },
169
170
  terminate_interaction: lambda { |msg|
170
171
  puts
@@ -179,8 +180,9 @@ module ConfigureTrustedPublisher
179
180
  "trusted_publisher" => {
180
181
  "repository_name" => name,
181
182
  "repository_owner" => owner,
183
+ "environment" => environment,
182
184
  "workflow_filename" => "push_gem.yml"
183
- },
185
+ }.compact,
184
186
  "trusted_publisher_type" => "OIDC::TrustedPublisher::GitHubAction"
185
187
  }
186
188
 
@@ -250,6 +252,11 @@ module ConfigureTrustedPublisher
250
252
  return unless ask_yes_or_no("Would you like to add a github environment to allow customizing " \
251
253
  "prerequisites for the action?")
252
254
 
255
+ if Bundler.which("gh").nil?
256
+ exit "The GitHub CLI (gh) is required to add a GitHub environment. " \
257
+ "Please install it from https://cli.github.com/ and try again."
258
+ end
259
+
253
260
  env_name = "rubygems.org"
254
261
 
255
262
  owner, name = github_repository
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigureTrustedPublisher
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configure_trusted_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-08 00:00:00.000000000 Z
11
+ date: 2024-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler