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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be37d580380ed839c71802d1957700a394a4425eef2dec647dd36f3eeeab756a
4
- data.tar.gz: 1df460eb38491080b05e3322b0033a758bd350c650cb4ee4d23f21f1528d2767
3
+ metadata.gz: fded1bdab9c9f7b815ba521501cbc69bd500a76b58e65ce2d2ae455bcf92cf6e
4
+ data.tar.gz: efe398ac5a8273d99102ed79e01cdbb0babff72f290f230a5a215a0667c8b5ef
5
5
  SHA512:
6
- metadata.gz: b802d5b13a84c8a4c7b2655892144266505f9ee39e75ab9a30246d9e63776e48ff300229ccb882f31c7695065ff200396966f2d3d8adb0dc0c674a7a291e7a64
7
- data.tar.gz: c9bff3498db70bf2dd2806af9f39fda3d0cb7b6998192cf5fce3e6a6bc6ea4dabac9c3aa99f0d9d46a0dfdb43ac5768795e8aaf470b65e0b749b48fcff7f361a
6
+ metadata.gz: e92374a0c2ce8ebeafe69645a9331e377868c898f96c01ac38d1ce36c00da3c548c91562733ce8c9e28625d6bec629caff53e4d5d4498bde29d4edca3d15b284
7
+ data.tar.gz: 7e860d3c9a791f0b9c55266892d1094d237f947a2673dcea130f6ee83d4e9f202b8dc1ee6108495068eb534071f91e908628be683ac7dd594938a043f04a6307
@@ -0,0 +1,14 @@
1
+ name: cache-ci
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ schedule:
6
+ - cron: '0 0 */3 * *'
7
+ jobs:
8
+ build_ruby_cache:
9
+ runs-on: ubuntu-20.04
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ 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: |
@@ -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/ci.rb CHANGED
@@ -43,7 +43,7 @@ class Bard::CLI < Thor
43
43
  end
44
44
 
45
45
  def github_actions?
46
- File.exist?(".github/workflows/ci.yml")
46
+ `git remote get-url origin` =~ /^git@github\.com/
47
47
  end
48
48
  end
49
49
  end
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.50.3"
2
+ VERSION = "0.50.5"
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.3
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-03-17 00:00:00.000000000 Z
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