Module: Octokit::Client::ActionsWorkflowRuns

Included in:
Octokit::Client
Defined in:
lib/octokit/client/actions_workflow_runs.rb

Overview

Methods for the Actions Workflows runs API

Instance Method Summary collapse

Instance Method Details

#cancel_workflow_run(repo, id, options = {}) ⇒ Boolean

Cancels a workflow run



73
74
75
# File 'lib/octokit/client/actions_workflow_runs.rb', line 73

def cancel_workflow_run(repo, id, options = {})
  boolean_from_response :post, "#{Repository.path repo}/actions/runs/#{id}/cancel", options
end

#delete_workflow_run(repo, id, options = {}) ⇒ Boolean

Deletes a workflow run



84
85
86
# File 'lib/octokit/client/actions_workflow_runs.rb', line 84

def delete_workflow_run(repo, id, options = {})
  boolean_from_response :delete, "#{Repository.path repo}/actions/runs/#{id}", options
end

#delete_workflow_run_logs(repo, id, options = {}) ⇒ Boolean

Delete all log files of a workflow run



109
110
111
# File 'lib/octokit/client/actions_workflow_runs.rb', line 109

def delete_workflow_run_logs(repo, id, options = {})
  boolean_from_response :delete, "#{Repository.path repo}/actions/runs/#{id}/logs", options
end

#repository_workflow_runs(repo, options = {}) ⇒ Sawyer::Resource Also known as: list_repository_workflow_runs

List all workflow runs for a repository

Options Hash (options):

  • :actor (String)

    Optional filtering by the login of a user

  • :branch (String)

    Optional filtering by a branch

  • :event (String)

    Optional filtering by the event type (e.g. push, pull_request, issue)

  • :status (String)

    Optional filtering by a status or conclusion (e.g. success, completed…)

See Also:



37
38
39
40
41
# File 'lib/octokit/client/actions_workflow_runs.rb', line 37

def repository_workflow_runs(repo, options = {})
  paginate "#{Repository.path repo}/actions/runs", options do |data, last_response|
    data.workflow_runs.concat last_response.data.workflow_runs
  end
end

#rerun_workflow_run(repo, id, options = {}) ⇒ Boolean

Re-runs a workflow run



62
63
64
# File 'lib/octokit/client/actions_workflow_runs.rb', line 62

def rerun_workflow_run(repo, id, options = {})
  boolean_from_response :post, "#{Repository.path repo}/actions/runs/#{id}/rerun", options
end

#workflow_run(repo, id, options = {}) ⇒ Sawyer::Resource

Get a workflow run



51
52
53
# File 'lib/octokit/client/actions_workflow_runs.rb', line 51

def workflow_run(repo, id, options = {})
  get "#{Repository.path repo}/actions/runs/#{id}", options
end

#workflow_run_logs(repo, id, options = {}) ⇒ String

Get a download url for archived log files of a workflow run



95
96
97
98
99
100
# File 'lib/octokit/client/actions_workflow_runs.rb', line 95

def workflow_run_logs(repo, id, options = {})
  url = "#{Repository.path repo}/actions/runs/#{id}/logs"

  response = client_without_redirects.head(url, options)
  response.headers['Location']
end

#workflow_run_usage(repo, id, options = {}) ⇒ Sawyer::Resource

Get workflow run usage



120
121
122
# File 'lib/octokit/client/actions_workflow_runs.rb', line 120

def workflow_run_usage(repo, id, options = {})
  get "#{Repository.path repo}/actions/runs/#{id}/timing", options
end

#workflow_runs(repo, workflow, options = {}) ⇒ Sawyer::Resource Also known as: list_workflow_runs

List all runs for a repository workflow

Options Hash (options):

  • :actor (String)

    Optional filtering by a user

  • :branch (String)

    Optional filtering by a branch

  • :event (String)

    Optional filtering by the event type

  • :status (String)

    Optional filtering by a status or conclusion

See Also:



20
21
22
23
24
# File 'lib/octokit/client/actions_workflow_runs.rb', line 20

def workflow_runs(repo, workflow, options = {})
  paginate "#{Repository.path repo}/actions/workflows/#{workflow}/runs", options do |data, last_response|
    data.workflow_runs.concat last_response.data.workflow_runs
  end
end