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
130 131 132 |
# File 'lib/bard/ci/github_actions.rb', line 130 def branch json["head_branch"] end |
#building? ⇒ Boolean
109 110 111 112 |
# File 'lib/bard/ci/github_actions.rb', line 109 def building? %w[in_progress queued requested waiting pending] .include?(json["status"]) end |
#conclusion ⇒ Object
142 143 144 |
# File 'lib/bard/ci/github_actions.rb', line 142 def conclusion json["conclusion"] end |
#console ⇒ Object
126 127 128 |
# File 'lib/bard/ci/github_actions.rb', line 126 def console job.logs end |
#failure? ⇒ Boolean
118 119 120 |
# File 'lib/bard/ci/github_actions.rb', line 118 def failure? conclusion == "failure" end |
#id ⇒ Object
101 102 103 |
# File 'lib/bard/ci/github_actions.rb', line 101 def id json["id"] end |
#job ⇒ Object
122 123 124 |
# File 'lib/bard/ci/github_actions.rb', line 122 def job @job ||= api.find_job_by_run_id(id) end |
#sha ⇒ Object
134 135 136 |
# File 'lib/bard/ci/github_actions.rb', line 134 def sha json["head_sha"] end |
#started_at ⇒ Object
146 147 148 |
# File 'lib/bard/ci/github_actions.rb', line 146 def started_at Time.parse(json["run_started_at"]) end |
#status ⇒ Object
138 139 140 |
# File 'lib/bard/ci/github_actions.rb', line 138 def status json["status"] end |
#success? ⇒ Boolean
114 115 116 |
# File 'lib/bard/ci/github_actions.rb', line 114 def success? status == "completed" && conclusion == "success" end |
#time_elapsed ⇒ Object
105 106 107 |
# File 'lib/bard/ci/github_actions.rb', line 105 def time_elapsed job.time_elapsed end |
#updated_at ⇒ Object
150 151 152 |
# File 'lib/bard/ci/github_actions.rb', line 150 def updated_at Time.parse(json["updated_at"]) end |