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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (Boolean)

    Returns true if the cancellation was accepted

See Also:



69
70
71
# File 'lib/octokit/client/actions_workflow_runs.rb', line 69

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (Boolean)

    Returns true if the run is deleted

See Also:



80
81
82
# File 'lib/octokit/client/actions_workflow_runs.rb', line 80

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (Boolean)

    Returns true if the logs are deleted

See Also:



105
106
107
# File 'lib/octokit/client/actions_workflow_runs.rb', line 105

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • options (Hash) (defaults to: {})

    a customizable set of options

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…)

Returns:

  • (Sawyer::Resource)

    the total count and an array of workflows

See Also:



35
36
37
# File 'lib/octokit/client/actions_workflow_runs.rb', line 35

def repository_workflow_runs(repo, options = {})
  paginate "#{Repository.path repo}/actions/runs", options
end

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

Re-runs a workflow run

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (Boolean)

    Returns true if the re-run request was accepted

See Also:



58
59
60
# File 'lib/octokit/client/actions_workflow_runs.rb', line 58

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (Sawyer::Resource)

    Run information

See Also:



47
48
49
# File 'lib/octokit/client/actions_workflow_runs.rb', line 47

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (String)

    URL to the archived log files of the run

See Also:



91
92
93
94
95
96
# File 'lib/octokit/client/actions_workflow_runs.rb', line 91

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    Id of a workflow run

Returns:

  • (Sawyer::Resource)

    Run usage

See Also:



116
117
118
# File 'lib/octokit/client/actions_workflow_runs.rb', line 116

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

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • workflow (Integer, String)

    Id or file name of the workflow

  • options (Hash) (defaults to: {})

    a customizable set of options

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

Returns:

  • (Sawyer::Resource)

    the total count and an array of workflows

See Also:



20
21
22
# 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
end