Class: Bard::CI::GithubActions::Run
- Inherits:
-
Struct
- Object
- Struct
- Bard::CI::GithubActions::Run
- Defined in:
- lib/bard/plugins/deploy/ci/github_actions.rb
Instance Method Summary collapse
- #branch ⇒ Object
- #building? ⇒ Boolean
- #conclusion ⇒ Object
- #console ⇒ Object
- #failure? ⇒ Boolean
- #id ⇒ Object
- #job ⇒ Object
- #sha ⇒ Object
- #started_at ⇒ Object
- #status ⇒ Object
- #success? ⇒ Boolean
- #time_elapsed ⇒ Object
- #updated_at ⇒ Object
Instance Method Details
#branch ⇒ Object
160 161 162 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 160 def branch json["head_branch"] end |
#building? ⇒ Boolean
139 140 141 142 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 139 def building? %w[in_progress queued requested waiting pending] .include?(json["status"]) end |
#conclusion ⇒ Object
172 173 174 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 172 def conclusion json["conclusion"] end |
#console ⇒ Object
156 157 158 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 156 def console job.logs end |
#failure? ⇒ Boolean
148 149 150 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 148 def failure? conclusion == "failure" end |
#id ⇒ Object
131 132 133 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 131 def id json["id"] end |
#job ⇒ Object
152 153 154 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 152 def job @job ||= api.find_job_by_run_id(id) end |
#sha ⇒ Object
164 165 166 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 164 def sha json["head_sha"] end |
#started_at ⇒ Object
176 177 178 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 176 def started_at Time.parse(json["run_started_at"]) end |
#status ⇒ Object
168 169 170 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 168 def status json["status"] end |
#success? ⇒ Boolean
144 145 146 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 144 def success? status == "completed" && conclusion == "success" end |
#time_elapsed ⇒ Object
135 136 137 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 135 def time_elapsed job.time_elapsed end |
#updated_at ⇒ Object
180 181 182 |
# File 'lib/bard/plugins/deploy/ci/github_actions.rb', line 180 def updated_at Time.parse(json["updated_at"]) end |