Class: Bard::CLI::CI::GithubActions::Run

Inherits:
Struct
  • Object
show all
Defined in:
lib/bard/ci/github_actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#apiObject

Returns the value of attribute api

Returns:

  • (Object)

    the current value of api



79
80
81
# File 'lib/bard/ci/github_actions.rb', line 79

def api
  @api
end

#jsonObject

Returns the value of attribute json

Returns:

  • (Object)

    the current value of json



79
80
81
# File 'lib/bard/ci/github_actions.rb', line 79

def json
  @json
end

Instance Method Details

#building?Boolean

Returns:

  • (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

#consoleObject



101
102
103
# File 'lib/bard/ci/github_actions.rb', line 101

def console
  job.logs
end

#idObject



80
81
82
# File 'lib/bard/ci/github_actions.rb', line 80

def id
  json["id"]
end

#jobObject



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

Returns:

  • (Boolean)


93
94
95
# File 'lib/bard/ci/github_actions.rb', line 93

def success?
  json["status"] == "completed" && json["conclusion"] == "success"
end

#time_elapsedObject



84
85
86
# File 'lib/bard/ci/github_actions.rb', line 84

def time_elapsed
  job.time_elapsed
end