module Octokit::Client::ActionsWorkflows

Methods for the Actions Workflows API

@see developer.github.com/v3/actions/workflows

Public Instance Methods

list_workflows(repo, options = {})
Alias for: workflows
workflow(repo, id, options = {}) click to toggle source

Get single workflow in a repository

@param repo [Integer, String, Repository, Hash] A GitHub repository @param id [Integer, String] Id or file name of the workflow

@return [Sawyer::Resource] A single workflow @see developer.github.com/v3/actions/workflows/#get-a-workflow

# File lib/octokit/client/actions_workflows.rb, line 29
def workflow(repo, id, options = {})
  get "#{Repository.path repo}/actions/workflows/#{id}", options
end
workflow_disable(repo, id, options = {}) click to toggle source

Disable a workflow

@param repo [Integer, String, Repository, Hash] A GitHub repository @param id [Integer, String] Id or file name of the workflow

@return [Boolean] True if workflow was disabled, false otherwise @see docs.github.com/en/rest/actions/workflows#disable-a-workflow

# File lib/octokit/client/actions_workflows.rb, line 63
def workflow_disable(repo, id, options = {})
  boolean_from_response :put, "#{Repository.path repo}/actions/workflows/#{id}/disable", options
end
workflow_dispatch(repo, id, ref, options = {}) click to toggle source

Create a workflow dispatch event

@param repo [Integer, String, Repository, Hash] A GitHub repository @param id [Integer, String] Id or file name of the workflow @param ref [String] A SHA, branch name, or tag name

@return [Boolean] True if event was dispatched, false otherwise @see docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event

# File lib/octokit/client/actions_workflows.rb, line 41
def workflow_dispatch(repo, id, ref, options = {})
  boolean_from_response :post, "#{Repository.path repo}/actions/workflows/#{id}/dispatches", options.merge({ ref: ref })
end
workflow_enable(repo, id, options = {}) click to toggle source

Enable a workflow

@param repo [Integer, String, Repository, Hash] A GitHub repository @param id [Integer, String] Id or file name of the workflow

@return [Boolean] True if workflow was enabled, false otherwise @see docs.github.com/en/rest/actions/workflows#enable-a-workflow

# File lib/octokit/client/actions_workflows.rb, line 52
def workflow_enable(repo, id, options = {})
  boolean_from_response :put, "#{Repository.path repo}/actions/workflows/#{id}/enable", options
end
workflows(repo, options = {}) click to toggle source

Get the workflows in a repository

@param repo [Integer, String, Repository, Hash] A GitHub repository

@return [Sawyer::Resource] the total count and an array of workflows @see developer.github.com/v3/actions/workflows/#list-repository-workflows

# File lib/octokit/client/actions_workflows.rb, line 15
def workflows(repo, options = {})
  paginate "#{Repository.path repo}/actions/workflows", options do |data, last_response|
    data.workflows.concat last_response.data.workflows
  end
end
Also aliased as: list_workflows