module Octokit::Client::ActionsWorkflows
def workflow(repo, id, options = {})
- See: https://developer.github.com/v3/actions/workflows/#get-a-workflow -
Returns:
-
(Sawyer::Resource)
- A single workflow
Parameters:
-
id
(Integer, String
) -- Id or file name of the workflow -
repo
(Integer, String, Repository, Hash
) -- A GitHub repository
def workflow(repo, id, options = {}) get "#{Repository.path repo}/actions/workflows/#{id}", options end
def workflow_disable(repo, id, options = {})
- See: https://docs.github.com/en/rest/actions/workflows#disable-a-workflow -
Returns:
-
(Boolean)
- True if workflow was disabled, false otherwise
Parameters:
-
id
(Integer, String
) -- Id or file name of the workflow -
repo
(Integer, String, Repository, Hash
) -- A GitHub repository
def workflow_disable(repo, id, options = {}) boolean_from_response :put, "#{Repository.path repo}/actions/workflows/#{id}/disable", options end
def workflow_dispatch(repo, id, ref, options = {})
- See: https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event -
Returns:
-
(Boolean)
- True if event was dispatched, false otherwise
Parameters:
-
ref
(String
) -- A SHA, branch name, or tag name -
id
(Integer, String
) -- Id or file name of the workflow -
repo
(Integer, String, Repository, Hash
) -- A GitHub repository
def workflow_dispatch(repo, id, ref, options = {}) boolean_from_response :post, "#{Repository.path repo}/actions/workflows/#{id}/dispatches", options.merge({ ref: ref }) end
def workflow_enable(repo, id, options = {})
- See: https://docs.github.com/en/rest/actions/workflows#enable-a-workflow -
Returns:
-
(Boolean)
- True if workflow was enabled, false otherwise
Parameters:
-
id
(Integer, String
) -- Id or file name of the workflow -
repo
(Integer, String, Repository, Hash
) -- A GitHub repository
def workflow_enable(repo, id, options = {}) boolean_from_response :put, "#{Repository.path repo}/actions/workflows/#{id}/enable", options end
def workflows(repo, options = {})
- See: https://developer.github.com/v3/actions/workflows/#list-repository-workflows -
Returns:
-
(Sawyer::Resource)
- the total count and an array of workflows
Parameters:
-
repo
(Integer, String, Repository, Hash
) -- A GitHub repository
def workflows(repo, options = {}) paginate "#{Repository.path repo}/actions/workflows", options do |data, last_response| data.workflows.concat last_response.data.workflows end end