souls 1.8.10 → 1.8.15

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: 32745af9b5a52413990e7877b58dc195c0a6477027456e0e1054f67460e0e228
4
+ data.tar.gz: e09028d257f4837aa3e2161ed5dde29b44fa56f3d3d4392731410c1fbcbeb96c
5
5
  SHA512:
6
- metadata.gz: 871f8c9700d17af737774497ed3ae33c9c0a45319668a8e9f35f86343cdecda866f925e8069b5c935454fcbf8f108477d488b966a02d7318a422e80df011f012
7
- data.tar.gz: 482112b4772e5881119d28c4a30ae2510108f396e93bde818b7bb53be069b8f0b8b84eaaf8049fc05a8fa3329983fd88c831268de25dce01102cec074f37b632
6
+ metadata.gz: d4e27c8d6a3da3c2e90176ee859964213ac34d23da244bf24429b7d842558e609cb86b65506b1ed3590c9c6c6cd3e313f24eb5e8ee9e2eaea87fbcef99a2bf53
7
+ data.tar.gz: 3a7f47c761f6a5627375a723e95a00de9461f6023600dd0228a17041d6f92fecdf3b779ec2a2ad4d0119fbf1dfdf16df586ab0638ecbc2d0c6ab63675ecae746
@@ -30,20 +30,28 @@ 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|
40
- { wf["name"].to_sym => wf["id"] } if wf["state"] == "in_progress"
48
+ { wf["name"].to_sym => wf["id"] } if wf["status"] == "in_progress"
41
49
  end
42
50
 
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.15".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.8.10
1
+ 1.8.15
@@ -1 +1 @@
1
- 1.8.10
1
+ 1.8.15
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.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI