Class: Bard::CI::GithubActions::Run
- Inherits:
-
Struct
- Object
- Struct
- Bard::CI::GithubActions::Run
- Defined in:
- lib/bard/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
161 162 163 |
# File 'lib/bard/ci/github_actions.rb', line 161 def branch json["head_branch"] end |
#building? ⇒ Boolean
140 141 142 143 |
# File 'lib/bard/ci/github_actions.rb', line 140 def building? %w[in_progress queued requested waiting pending] .include?(json["status"]) end |
#conclusion ⇒ Object
173 174 175 |
# File 'lib/bard/ci/github_actions.rb', line 173 def conclusion json["conclusion"] end |
#console ⇒ Object
157 158 159 |
# File 'lib/bard/ci/github_actions.rb', line 157 def console job.logs end |
#failure? ⇒ Boolean
149 150 151 |
# File 'lib/bard/ci/github_actions.rb', line 149 def failure? conclusion == "failure" end |
#id ⇒ Object
132 133 134 |
# File 'lib/bard/ci/github_actions.rb', line 132 def id json["id"] end |
#job ⇒ Object
153 154 155 |
# File 'lib/bard/ci/github_actions.rb', line 153 def job @job ||= api.find_job_by_run_id(id) end |
#sha ⇒ Object
165 166 167 |
# File 'lib/bard/ci/github_actions.rb', line 165 def sha json["head_sha"] end |
#started_at ⇒ Object
177 178 179 |
# File 'lib/bard/ci/github_actions.rb', line 177 def started_at Time.parse(json["run_started_at"]) end |
#status ⇒ Object
169 170 171 |
# File 'lib/bard/ci/github_actions.rb', line 169 def status json["status"] end |
#success? ⇒ Boolean
145 146 147 |
# File 'lib/bard/ci/github_actions.rb', line 145 def success? status == "completed" && conclusion == "success" end |
#time_elapsed ⇒ Object
136 137 138 |
# File 'lib/bard/ci/github_actions.rb', line 136 def time_elapsed job.time_elapsed end |
#updated_at ⇒ Object
181 182 183 |
# File 'lib/bard/ci/github_actions.rb', line 181 def updated_at Time.parse(json["updated_at"]) end |