souls 1.8.8 → 1.8.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3008e8f3c693f08dceed2d39e068fded99cd451028fb16cb682dc37ae091727a
4
- data.tar.gz: d1f43ed9ace0909791ccb69021f0416ff2918ba61f99bc63fd964cf10a96570e
3
+ metadata.gz: e8ff92925b8c92d38138539701be39b497a78752fcae8395fbc5c4975c011eaf
4
+ data.tar.gz: a2b901a382bc62498a3ae613a696503dd5c27eea7faa243b418b2cf18013e36c
5
5
  SHA512:
6
- metadata.gz: fcd880cbd079096b8f083cc999379d1a5582a6d626bd27b8fcd74bc83a985625cbedae16afb5c153e639a8deb56e0ea49874d268df7c553ab442913b0ee008f7
7
- data.tar.gz: cf54ecf40cf18dda9203aa54a17b975d4fe570eeff85029305663813e0a11d3575c0c7340c923e5f110fd6e4514b39f538645d21278e32209af9ea7aa6689c9b
6
+ metadata.gz: 5928d3c61c8304ad2a5abfa30c63d730ff5c48838fc040a59014949d49e6babc5717326d42f2648ebe3d287b614bdf295094526ecf136da4865bedd861f554c2
7
+ data.tar.gz: ff2a2fbe41b58720b533f1ede4910f55d92e5461846bd3ae0608e4b8dbba762ab55de7f28fef8951ccfa51cb0e5d133ae3514d1b3896b99fd12d1d597a9a372a
@@ -195,6 +195,7 @@ end
195
195
  --set-env-vars="SOULS_DB_USER=${{ secrets.SOULS_DB_USER }}" \\
196
196
  --set-env-vars="SOULS_DB_PW=${{ secrets.SOULS_DB_PW }}" \\
197
197
  --set-env-vars="SOULS_DB_HOST=${{ secrets.SOULS_DB_HOST }}" \\
198
+ --set-env-vars="GITHUB_REPOSITORY=$GITHUB_REPOSITORY" \\
198
199
  --set-env-vars="SOULS_TZ=${{ secrets.SOULS_TZ }}" \\
199
200
  --set-env-vars="SOULS_SECRET_KEY_BASE=${{ secrets.SOULS_SECRET_KEY_BASE }}" \\
200
201
  --set-env-vars="SOULS_PROJECT_ID=${{ secrets.SOULS_GCP_PROJECT_ID }}"
@@ -30,6 +30,7 @@ module Souls
30
30
  SOULS_DB_USER=postgres
31
31
  SOULS_GCP_PROJECT_ID=#{project_id}
32
32
  SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
33
+ GITHUB_REPOSITORY='elsoul/souls'
33
34
  TZ="#{region_to_timezone(region: region)}"
34
35
  TEXT
35
36
  end
@@ -46,6 +47,7 @@ module Souls
46
47
  SOULS_GCP_REGION=#{region}
47
48
  SOULS_GCLOUDSQL_INSTANCE="#{project_id}:#{region}:#{instance_name}"
48
49
  SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
50
+ GITHUB_REPOSITORY='elsoul/souls'
49
51
  TZ="#{region_to_timezone(region: region)}"
50
52
  TEXT
51
53
  end
@@ -30,17 +30,28 @@ module Souls
30
30
 
31
31
  desc "watch", "Watch GitHub Actions Workflow"
32
32
  def watch
33
- workflows = JSON.parse(`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'"
40
+ workflows = JSON.parse(`#{api_request}`)
41
+
42
+ if workflows.nil? || !workflows.key?("workflow_runs")
43
+ raise(CLIException, "Failed to parse JSON response from Github")
44
+ end
34
45
 
35
46
  wf_info =
36
47
  workflows["workflow_runs"].filter_map do |wf|
37
- { wf["name"].to_sym => wf["id"] } if wf["state"] == "in_progress"
48
+ { wf["name"].to_sym => wf["id"] } if wf["status"] == "in_progress"
38
49
  end
39
50
 
40
51
  wf_id =
41
52
  case wf_info.size
42
53
  when 0
43
- raise(CLIException, "No workflow is running.")
54
+ raise(CLIException, "No workflow is running")
44
55
  when 1
45
56
  wf_info[0].values[0]
46
57
  else
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.8.8".freeze
2
+ VERSION = "1.8.13".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.8.8
1
+ 1.8.13
@@ -1 +1 @@
1
- 1.8.8
1
+ 1.8.13
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.8
4
+ version: 1.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI