bard 0.50.3 → 0.50.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/install_files/.github/workflows/cache-ci.yml +14 -0
- data/install_files/.github/workflows/ci.yml +2 -1
- data/lib/bard/ci/github_actions.rb +12 -10
- data/lib/bard/ci.rb +1 -1
- data/lib/bard/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fded1bdab9c9f7b815ba521501cbc69bd500a76b58e65ce2d2ae455bcf92cf6e
|
4
|
+
data.tar.gz: efe398ac5a8273d99102ed79e01cdbb0babff72f290f230a5a215a0667c8b5ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92374a0c2ce8ebeafe69645a9331e377868c898f96c01ac38d1ce36c00da3c548c91562733ce8c9e28625d6bec629caff53e4d5d4498bde29d4edca3d15b284
|
7
|
+
data.tar.gz: 7e860d3c9a791f0b9c55266892d1094d237f947a2673dcea130f6ee83d4e9f202b8dc1ee6108495068eb534071f91e908628be683ac7dd594938a043f04a6307
|
@@ -8,7 +8,7 @@ class Bard::CLI < Thor
|
|
8
8
|
class GithubActions < Struct.new(:project_name, :branch, :sha)
|
9
9
|
def run
|
10
10
|
api = API.new(project_name)
|
11
|
-
last_time_elapsed = api.last_successful_run
|
11
|
+
last_time_elapsed = api.last_successful_run&.time_elapsed
|
12
12
|
@run = api.create_run!(branch)
|
13
13
|
|
14
14
|
start_time = Time.new.to_i
|
@@ -35,9 +35,10 @@ class Bard::CLI < Thor
|
|
35
35
|
|
36
36
|
class API < Struct.new(:project_name)
|
37
37
|
def last_successful_run
|
38
|
-
successful_runs = client.get("runs", status: "success", per_page: 1)
|
39
|
-
json = successful_runs["workflow_runs"][0]
|
40
|
-
|
38
|
+
successful_runs = client.get("runs", event: "workflow_dispatch", status: "success", per_page: 1)
|
39
|
+
if json = successful_runs["workflow_runs"][0]
|
40
|
+
Run.new(self, json)
|
41
|
+
end
|
41
42
|
end
|
42
43
|
|
43
44
|
def find_run id
|
@@ -150,12 +151,13 @@ class Bard::CLI < Thor
|
|
150
151
|
URI("https://api.github.com/repos/botandrosedesign/#{project_name}/actions/#{path}")
|
151
152
|
end
|
152
153
|
|
154
|
+
req = nil
|
153
155
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
http.request(
|
156
|
+
req = block.call(uri)
|
157
|
+
req["Accept"] = "application/vnd.github+json"
|
158
|
+
req["Authorization"] = "Bearer #{github_apikey}"
|
159
|
+
req["X-GitHub-Api-Version"] = "2022-11-28"
|
160
|
+
http.request(req)
|
159
161
|
end
|
160
162
|
|
161
163
|
case response
|
@@ -171,7 +173,7 @@ class Bard::CLI < Thor
|
|
171
173
|
response.body
|
172
174
|
end
|
173
175
|
else
|
174
|
-
raise response.inspect
|
176
|
+
raise [req.method, req.uri, req.to_hash, response].inspect
|
175
177
|
end
|
176
178
|
end
|
177
179
|
end
|
data/lib/bard/ci.rb
CHANGED
data/lib/bard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.50.
|
4
|
+
version: 0.50.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- features/support/env.rb
|
139
139
|
- features/support/grit_ext.rb
|
140
140
|
- features/support/io.rb
|
141
|
+
- install_files/.github/workflows/cache-ci.yml
|
141
142
|
- install_files/.github/workflows/ci.yml
|
142
143
|
- install_files/apt_dependencies.rb
|
143
144
|
- install_files/ci
|