Class: Bard::CLI::CI::GithubActions::Run
- Inherits:
-
Struct
- Object
- Struct
- Bard::CLI::CI::GithubActions::Run
- Defined in:
- lib/bard/ci/github_actions.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
- #building? ⇒ Boolean
- #console ⇒ Object
- #id ⇒ Object
- #job ⇒ Object
- #success? ⇒ Boolean
- #time_elapsed ⇒ Object
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api
79 80 81 |
# File 'lib/bard/ci/github_actions.rb', line 79 def api @api end |
#json ⇒ Object
Returns the value of attribute json
79 80 81 |
# File 'lib/bard/ci/github_actions.rb', line 79 def json @json end |
Instance Method Details
#building? ⇒ Boolean
88 89 90 91 |
# File 'lib/bard/ci/github_actions.rb', line 88 def building? %w[in_progress queued requested waiting pending] .include?(json["status"]) end |
#console ⇒ Object
101 102 103 |
# File 'lib/bard/ci/github_actions.rb', line 101 def console job.logs end |
#id ⇒ Object
80 81 82 |
# File 'lib/bard/ci/github_actions.rb', line 80 def id json["id"] end |
#job ⇒ Object
97 98 99 |
# File 'lib/bard/ci/github_actions.rb', line 97 def job @job ||= api.find_job_by_run_id(id) end |
#success? ⇒ Boolean
93 94 95 |
# File 'lib/bard/ci/github_actions.rb', line 93 def success? json["status"] == "completed" && json["conclusion"] == "success" end |
#time_elapsed ⇒ Object
84 85 86 |
# File 'lib/bard/ci/github_actions.rb', line 84 def time_elapsed job.time_elapsed end |