configure_trusted_publisher 0.1.9 → 0.1.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8825e07f3f9352aeda01d6f45d1806e6d148cad2c7583595126989efcf1a9ba
|
4
|
+
data.tar.gz: 86ddce0733c9831c87e5b374ca1d69e3f36751da515cd6ddcaf19d02e6652222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ef9d2fb3b4848d8e5241fce485cb1dbe9ef66d6a2d1b8a6479ea7381e97ce4281d0b9db57b3b93a89060229618aac4c6efd9a77ddbd7f5bc3221497dfbafb73
|
7
|
+
data.tar.gz: fe25ac3a350ebaf0dffacd5ac734a4aab5a6f2b1f3b80d38727b3dac91612da11b79e6f0e56610836346f131118b5ed4b072f51492b4f7e0991a07a7f39fd67c
|
@@ -169,7 +169,7 @@ module ConfigureTrustedPublisher
|
|
169
169
|
},
|
170
170
|
terminate_interaction: lambda { |msg|
|
171
171
|
puts
|
172
|
-
|
172
|
+
abort msg
|
173
173
|
},
|
174
174
|
otp: options[:otp]
|
175
175
|
)
|
@@ -253,8 +253,8 @@ module ConfigureTrustedPublisher
|
|
253
253
|
"prerequisites for the action?")
|
254
254
|
|
255
255
|
if Bundler.which("gh").nil?
|
256
|
-
|
257
|
-
|
256
|
+
abort "The GitHub CLI (gh) is required to add a GitHub environment. " \
|
257
|
+
"Please install it from https://cli.github.com/ and try again."
|
258
258
|
end
|
259
259
|
|
260
260
|
env_name = "rubygems.org"
|
@@ -262,7 +262,7 @@ module ConfigureTrustedPublisher
|
|
262
262
|
owner, name = github_repository
|
263
263
|
puts "Adding GitHub environment to #{owner}/#{name} to protect the action"
|
264
264
|
if (env = Open3.capture2e("gh", "api", "repos/#{owner}/#{name}/environments").then do |output, status|
|
265
|
-
|
265
|
+
abort "Failed to list environments for #{owner}/#{name} using `gh api`:\n#{output}" unless status.success?
|
266
266
|
|
267
267
|
JSON.parse(output)["environments"].find { |e| e["name"] == env_name }
|
268
268
|
end)
|
@@ -273,7 +273,7 @@ module ConfigureTrustedPublisher
|
|
273
273
|
Open3.capture2e("gh", "api", "--method", "PUT",
|
274
274
|
"repos/#{owner}/#{name}/environments/#{env_name}").then do |output, status|
|
275
275
|
unless status.success?
|
276
|
-
|
276
|
+
abort "Failed to create rubygems.org environment for #{owner}/#{name} using `gh api`:\n#{output}"
|
277
277
|
end
|
278
278
|
|
279
279
|
env = JSON.parse(output)
|