bard 0.50.2 → 0.50.4

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: 805a92390c2917eeada517a6bc16b6e2e05269d203d7865a1fa6eecd67100026
4
- data.tar.gz: d90481a4f76a4aeaf82368c391c30e525e29565cfefbe5517aa7e88c98476031
3
+ metadata.gz: f6698258c4e115c0c417131b370472ddda9319280422472c92005e2a88b48460
4
+ data.tar.gz: 54e3c1d1897cdbb7a8338c47ec5edba11c2c18b67252d0ce99be8836591845b1
5
5
  SHA512:
6
- metadata.gz: 1863f7bf1bf5336de2227dee80ef71fb7792b11dd3c31b4102f66b898a770f860b260cec73680ea50fe1516d9aa19360130e2a12950ec0bb7d5ed3d58aaacd07
7
- data.tar.gz: 00650d41d9add6bdffe44701a21b7649868bdf9948e84d8490a341bbb4252257171288715bd2535649f384cf8e2171460f976b70d8840278e2aa61b03c085fda
6
+ metadata.gz: c5af008795ac9530ee1491a3c7adf05b0fe6fd83b579cd6d3104b00517d5e5b9d67bbab58408f637d028a560ec4cd8d611b3dc7522f8def13ad2c77b3d09ac80
7
+ data.tar.gz: 23dbfce0a6cfdf9f07cec3e48a29b714c95d587db0a9998b9aa126fe7ae81079d751bcbaeab8e72e631c576e10a020894681c4ca2d8757723a16c7125387b8ba
@@ -0,0 +1,12 @@
1
+ name: cache-ci
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ jobs:
6
+ build_ruby_cache:
7
+ runs-on: ubuntu-20.04
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ - uses: ruby/setup-ruby@v1
11
+ with:
12
+ bundler-cache: true
@@ -8,9 +8,10 @@ on:
8
8
  required: true
9
9
  jobs:
10
10
  test:
11
- runs-on: ubuntu-20.04
11
+ runs-on: ubuntu-20.04-16core
12
12
  env:
13
13
  RAILS_ENV: test
14
+ RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
14
15
  steps:
15
16
  - name: Set up MySQL
16
17
  run: |
@@ -4,17 +4,17 @@ module AptDependencies
4
4
  def self.ensure!
5
5
  return "true" if deps_to_install.none?
6
6
  if sudo_password_required? && ENV["RAILS_ENV"] != "development"
7
- $stderr.puts "sudo requires password! cannot install #{deps_to_install.join}"
7
+ $stderr.puts "sudo requires password! cannot install #{deps_to_install.join(' ')}"
8
8
  exit 1
9
9
  else
10
- "sudo apt install -y #{deps_to_install.join}"
10
+ "sudo apt install -y #{deps_to_install.join(' ')}"
11
11
  end
12
12
  end
13
13
 
14
14
  private
15
15
 
16
16
  def deps_to_install
17
- installed_deps = `apt list imagemagick thunderbird --installed 2>/dev/null`.chomp.split("\n")[1..]
17
+ installed_deps = `apt list #{deps.join(' ')} --installed 2>/dev/null`.chomp.split("\n")[1..]
18
18
  .map { |line| line.split("/")[0] }
19
19
  deps - installed_deps
20
20
  end
@@ -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.time_elapsed
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
- Run.new(self, json)
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
- request = block.call(uri)
155
- request["Accept"] = "application/vnd.github+json"
156
- request["Authorization"] = "Token #{github_apikey}"
157
- request["X-GitHub-Api-Version"] = "2022-11-28"
158
- http.request(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/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.50.2"
2
+ VERSION = "0.50.4"
3
3
  end
4
4
 
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.2
4
+ version: 0.50.4
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-03-16 00:00:00.000000000 Z
11
+ date: 2023-03-27 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
@@ -178,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
179
  - !ruby/object:Gem::Version
179
180
  version: '0'
180
181
  requirements: []
181
- rubygems_version: 3.2.32
182
+ rubygems_version: 3.3.26
182
183
  signing_key:
183
184
  specification_version: 4
184
185
  summary: CLI to automate common development tasks.