firespring_dev_commands 2.2.1.pre.alpha.3 → 2.2.1.pre.alpha.5
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: 3d7e4f3cd658062916858f6dc08e38e7dc1a346058212b2f40690115d196d76e
|
4
|
+
data.tar.gz: 95d1957b93525c62e431bcdd98428fd7a76cec245408be293264ec0971ca1bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a362784e6e4596383298e5f3e2712dcb3b39c73f573e868b62df903c41d620b7c7c53beef1e7b7942e70e549a408d6ebb475523bc250a909c3a0fcfe00023bb8
|
7
|
+
data.tar.gz: 0a8135fec8781ff07e769e43da48b112849239baf769530596c3cfc75282c623406495200918a160b27c8434a27762ca533a5c69591725962e6dea3dd065339a
|
@@ -429,20 +429,17 @@ module Dev
|
|
429
429
|
g.fetch('origin', prune: true)
|
430
430
|
end
|
431
431
|
|
432
|
-
def commit_status(token:, repo_name:,
|
432
|
+
def commit_status(token:, repo_name:, commit_id:, status:, repo_org: nil, options: {})
|
433
433
|
# TODO: Split out the default of 'firespring' into a configuration variable
|
434
434
|
repo_org = 'firespring' if repo_org.to_s.strip.empty?
|
435
|
+
repo = "#{repo_org}/#{repo_name}"
|
435
436
|
|
436
437
|
# Set up the GitHub client
|
437
438
|
client = Octokit::Client.new(access_token: token)
|
438
439
|
|
439
|
-
# Fetch the latest commit SHA for the given branch
|
440
|
-
repo = "#{repo_org}/#{repo_name}"
|
441
|
-
ref = "heads/#{branch}"
|
442
|
-
sha = client.ref(repo, ref).object.sha
|
443
|
-
|
444
440
|
# Create the commit status
|
445
|
-
|
441
|
+
puts "Tagging commit #{commit_id} in #{repo} as #{status} for #{options[:context]}"
|
442
|
+
client.create_status(repo, commit_id, status, options)
|
446
443
|
end
|
447
444
|
|
448
445
|
# Builds an ssh repo URL using the org and repo name given
|
@@ -173,24 +173,24 @@ module Dev
|
|
173
173
|
desc 'Add pending status to commit' \
|
174
174
|
"\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
|
175
175
|
"\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
|
176
|
-
"\n\tuse
|
176
|
+
"\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
|
177
177
|
"\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
|
178
178
|
"\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
|
179
179
|
task :pending do
|
180
180
|
status = 'pending'
|
181
181
|
token = ENV['GITHUB_TOKEN'].to_s.strip
|
182
182
|
repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
|
183
|
-
|
183
|
+
commit_id = ENV['COMMIT_ID'].to_s.strip
|
184
184
|
|
185
185
|
raise 'GITHUB_TOKEN is required' unless token
|
186
|
-
raise '
|
187
|
-
raise '
|
186
|
+
raise 'REPOSITORY is required' unless repo_name
|
187
|
+
raise 'COMMIT_ID is required' unless commit_id
|
188
188
|
|
189
189
|
options = {}
|
190
190
|
options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
|
191
191
|
options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
|
192
192
|
|
193
|
-
Dev::Git.new.commit_status(token:, repo_name:,
|
193
|
+
Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
|
194
194
|
end
|
195
195
|
end
|
196
196
|
end
|
@@ -210,24 +210,24 @@ module Dev
|
|
210
210
|
desc 'Add success status to commit' \
|
211
211
|
"\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
|
212
212
|
"\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
|
213
|
-
"\n\tuse
|
213
|
+
"\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
|
214
214
|
"\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
|
215
215
|
"\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
|
216
216
|
task :success do
|
217
217
|
status = 'success'
|
218
218
|
token = ENV['GITHUB_TOKEN'].to_s.strip
|
219
219
|
repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
|
220
|
-
|
220
|
+
commit_id = ENV['COMMIT_ID'].to_s.strip
|
221
221
|
|
222
222
|
raise 'GITHUB_TOKEN is required' unless token
|
223
|
-
raise '
|
224
|
-
raise '
|
223
|
+
raise 'REPOSITORY is required' unless repo_name
|
224
|
+
raise 'COMMIT_ID is required' unless commit_id
|
225
225
|
|
226
226
|
options = {}
|
227
227
|
options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
|
228
228
|
options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
|
229
229
|
|
230
|
-
Dev::Git.new.commit_status(token:, repo_name:,
|
230
|
+
Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
|
231
231
|
end
|
232
232
|
end
|
233
233
|
end
|
@@ -247,24 +247,24 @@ module Dev
|
|
247
247
|
desc 'Add error status to commit' \
|
248
248
|
"\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
|
249
249
|
"\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
|
250
|
-
"\n\tuse
|
250
|
+
"\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
|
251
251
|
"\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
|
252
252
|
"\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
|
253
253
|
task :error do
|
254
254
|
status = 'error'
|
255
255
|
token = ENV['GITHUB_TOKEN'].to_s.strip
|
256
256
|
repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
|
257
|
-
|
257
|
+
commit_id = ENV['COMMIT_ID'].to_s.strip
|
258
258
|
|
259
259
|
raise 'GITHUB_TOKEN is required' unless token
|
260
|
-
raise '
|
261
|
-
raise '
|
260
|
+
raise 'REPOSITORY is required' unless repo_name
|
261
|
+
raise 'COMMIT_ID is required' unless commit_id
|
262
262
|
|
263
263
|
options = {}
|
264
264
|
options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
|
265
265
|
options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
|
266
266
|
|
267
|
-
Dev::Git.new.commit_status(token:, repo_name:,
|
267
|
+
Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
|
268
268
|
end
|
269
269
|
end
|
270
270
|
end
|
@@ -284,24 +284,24 @@ module Dev
|
|
284
284
|
desc 'Add failure status to commit' \
|
285
285
|
"\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
|
286
286
|
"\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
|
287
|
-
"\n\tuse
|
287
|
+
"\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
|
288
288
|
"\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
|
289
289
|
"\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
|
290
290
|
task :failure do
|
291
291
|
status = 'failure'
|
292
292
|
token = ENV['GITHUB_TOKEN'].to_s.strip
|
293
293
|
repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
|
294
|
-
|
294
|
+
commit_id = ENV['COMMIT_ID'].to_s.strip
|
295
295
|
|
296
296
|
raise 'GITHUB_TOKEN is required' unless token
|
297
|
-
raise '
|
298
|
-
raise '
|
297
|
+
raise 'REPOSITORY is required' unless repo_name
|
298
|
+
raise 'COMMIT_ID is required' unless commit_id
|
299
299
|
|
300
300
|
options = {}
|
301
301
|
options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
|
302
302
|
options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
|
303
303
|
|
304
|
-
Dev::Git.new.commit_status(token:, repo_name:,
|
304
|
+
Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
|
305
305
|
end
|
306
306
|
end
|
307
307
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.pre.alpha.
|
4
|
+
version: 2.2.1.pre.alpha.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|