souls 1.8.10 → 1.8.12

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: d138902b4d913eae055ae6810fb22f50b6a7cc2d4a3aaf57508b0856f56245ff
4
- data.tar.gz: 172bb024bc97eb9fd27421c36c4a5839768d5092ae11fd2992ba355bb4aaa27b
3
+ metadata.gz: 6c1ba3aa74c5c645b4b967cd05f5a7c6b5b162a49da104325af8d97f0e9b47c2
4
+ data.tar.gz: a8963851cfe5a371b6d32a33e0c0eb7ab432de32629c133e70780c87d240d9f3
5
5
  SHA512:
6
- metadata.gz: 871f8c9700d17af737774497ed3ae33c9c0a45319668a8e9f35f86343cdecda866f925e8069b5c935454fcbf8f108477d488b966a02d7318a422e80df011f012
7
- data.tar.gz: 482112b4772e5881119d28c4a30ae2510108f396e93bde818b7bb53be069b8f0b8b84eaaf8049fc05a8fa3329983fd88c831268de25dce01102cec074f37b632
6
+ metadata.gz: 230fb2d6dc29cfce296e74e98b84081de18aac2ab47a4252ffd0f795d508f897786455ce926cbd346638c1e0aa3cb128a833934ccf84513a36f5814fb4d81d2a
7
+ data.tar.gz: 0b503f9f9a4d5c2966af65092a5e352a8b5250ef6cea7eae2b2c3e5664543efcbd9ac9631f63a08ca7f4cd7ef97dab5625ba2f901a50c619b53774e501e21918
@@ -30,10 +30,18 @@ module Souls
30
30
 
31
31
  desc "watch", "Watch GitHub Actions Workflow"
32
32
  def watch
33
- api_request = "gh api -X GET 'repos/#{ENV['GITHUB_REPOSITORY']}/actions/runs'"
33
+ remote_url = `git remote get-url origin`
34
+ split_url = %r{\A(git@github.com:)(.+/.+)(\.git)}.match(remote_url)
35
+ if split_url.nil? || split_url.size != 4
36
+ raise(CLIException, "Cannot access Github, please check your credentials")
37
+ end
38
+
39
+ api_request = "gh api -X GET 'repos/#{split_url[2]}/actions/runs'"
34
40
  workflows = JSON.parse(`#{api_request}`)
35
41
 
36
- puts(api_request)
42
+ if workflows.nil? || !workflows.key?("workflow_runs")
43
+ raise(CLIException, "Failed to parse JSON response from Github")
44
+ end
37
45
 
38
46
  wf_info =
39
47
  workflows["workflow_runs"].filter_map do |wf|
@@ -43,7 +51,7 @@ module Souls
43
51
  wf_id =
44
52
  case wf_info.size
45
53
  when 0
46
- raise(CLIException, "No workflow is running.")
54
+ raise(CLIException, "No workflow is running")
47
55
  when 1
48
56
  wf_info[0].values[0]
49
57
  else
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.8.10".freeze
2
+ VERSION = "1.8.12".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.8.10
1
+ 1.8.12
@@ -1 +1 @@
1
- 1.8.10
1
+ 1.8.12
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.10
4
+ version: 1.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI