Class: GithubBot::Github::CheckRun
- Inherits:
-
Object
- Object
- GithubBot::Github::CheckRun
- Defined in:
- lib/github_bot/github/check_run.rb
Overview
Public: Class to keep track of the check run that has been created for execution
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The name/identifier of the check run.
Instance Method Summary collapse
-
#action_required!(**options) ⇒ Object
Public: Updates the check run to require action.
-
#complete!(**options) ⇒ Object
Public: Updates the check run to be complete.
-
#in_progress!(**options) ⇒ Object
Public: Updates the check run to be in progress.
-
#initialize(name:, repo:, sha:, client_api:, **opts) ⇒ CheckRun
constructor
Public: Create a new instance of the CheckRun.
-
#neutral!(**options) ⇒ Object
Public: Updates the check run to a neutral state.
Constructor Details
#initialize(name:, repo:, sha:, client_api:, **opts) ⇒ CheckRun
Public: Create a new instance of the CheckRun
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/github_bot/github/check_run.rb', line 17 def initialize(name:, repo:, sha:, client_api:, **opts) @client_api = client_api @repo = repo @sha = sha @name = name @run = @client_api.create_check_run( repo, name, sha, opts.merge( status: 'queued' ) ) end |
Instance Attribute Details
#name ⇒ Object (readonly)
The name/identifier of the check run
8 9 10 |
# File 'lib/github_bot/github/check_run.rb', line 8 def name @name end |
Instance Method Details
#action_required!(**options) ⇒ Object
Public: Updates the check run to require action
43 44 45 |
# File 'lib/github_bot/github/check_run.rb', line 43 def action_required!(**) update(status: 'completed', conclusion: 'action_required', completed_at: Time.now, **) end |
#complete!(**options) ⇒ Object
Public: Updates the check run to be complete
38 39 40 |
# File 'lib/github_bot/github/check_run.rb', line 38 def complete!(**) update(status: 'completed', conclusion: 'success', completed_at: Time.now, **) end |
#in_progress!(**options) ⇒ Object
Public: Updates the check run to be in progress
33 34 35 |
# File 'lib/github_bot/github/check_run.rb', line 33 def in_progress!(**) update(status: 'in_progress', started_at: Time.now, **) end |
#neutral!(**options) ⇒ Object
Public: Updates the check run to a neutral state
48 49 50 |
# File 'lib/github_bot/github/check_run.rb', line 48 def neutral!(**) update(status: 'completed', conclusion: 'neutral', completed_at: Time.now, **) end |