Module: Octokit::Client::ActionsWorkflows
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/actions_workflows.rb |
Overview
Methods for the Actions Workflows API
Instance Method Summary
-
#list_workflows(repo, options = {})
Alias for #workflows.
-
#workflow(repo, id, options = {}) ⇒ Sawyer::Resource
Get single workflow in a repository.
-
#workflow_disable(repo, id, options = {}) ⇒ Boolean
Disable a workflow.
-
#workflow_dispatch(repo, id, ref, options = {}) ⇒ Boolean
Create a workflow dispatch event.
-
#workflow_enable(repo, id, options = {}) ⇒ Boolean
Enable a workflow.
-
#workflows(repo, options = {}) ⇒ Sawyer::Resource
(also: #list_workflows)
Get the workflows in a repository.
Instance Method Details
#list_workflows(repo, options = {})
Alias for #workflows.
# File 'lib/octokit/client/actions_workflows.rb', line 20
alias list_workflows workflows
#workflow(repo, id, options = {}) ⇒ Sawyer::Resource
Get single workflow in a repository
# File 'lib/octokit/client/actions_workflows.rb', line 29
def workflow(repo, id, = {}) get "#{Repository.path repo}/actions/workflows/#{id}", end
#workflow_disable(repo, id, options = {}) ⇒ Boolean
Disable a workflow
# File 'lib/octokit/client/actions_workflows.rb', line 63
def workflow_disable(repo, id, = {}) boolean_from_response :put, "#{Repository.path repo}/actions/workflows/#{id}/disable", end
#workflow_dispatch(repo, id, ref, options = {}) ⇒ Boolean
Create a workflow dispatch event
# File 'lib/octokit/client/actions_workflows.rb', line 41
def workflow_dispatch(repo, id, ref, = {}) boolean_from_response :post, "#{Repository.path repo}/actions/workflows/#{id}/dispatches", .merge({ ref: ref }) end
#workflow_enable(repo, id, options = {}) ⇒ Boolean
Enable a workflow
# File 'lib/octokit/client/actions_workflows.rb', line 52
def workflow_enable(repo, id, = {}) boolean_from_response :put, "#{Repository.path repo}/actions/workflows/#{id}/enable", end
#workflows(repo, options = {}) ⇒ Sawyer::Resource
Also known as: #list_workflows
Get the workflows in a repository
# File 'lib/octokit/client/actions_workflows.rb', line 15
def workflows(repo, = {}) paginate "#{Repository.path repo}/actions/workflows", do |data, last_response| data.workflows.concat last_response.data.workflows end end