Sha256: 2be588c27e2c2931379063119344d3a833549b4c1a571d5cfa088ba2dc3214c0

Contents?: true

Size: 1.69 KB

Versions: 24

Compression:

Stored size: 1.69 KB

Contents

module Octokit
  class Client
    # Methods for the Actions Workflows API
    #
    # @see https://developer.github.com/v3/actions/workflows
    module ActionsWorkflows

      # 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 https://developer.github.com/v3/actions/workflows/#list-repository-workflows
      def workflows(repo, options = {})
        paginate "#{Repository.path repo}/actions/workflows", options
      end
      alias list_workflows workflows

      # 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 https://developer.github.com/v3/actions/workflows/#get-a-workflow
      def workflow(repo, id, options = {})
        get "#{Repository.path repo}/actions/workflows/#{id}", options
      end

      # 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 https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event
      def workflow_dispatch(repo, id, ref, options = {})
        boolean_from_response :post, "#{Repository.path repo}/actions/workflows/#{id}/dispatches", options.merge({ ref: ref })
      end
    end
  end
end

Version data entries

24 entries across 13 versions & 2 rubygems

Version Path
octokit-4.24.0 lib/octokit/client/actions_workflows.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/octokit-4.23.0/lib/octokit/client/actions_workflows.rb
octokit-4.23.0 lib/octokit/client/actions_workflows.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/octokit-4.22.0/lib/octokit/client/actions_workflows.rb
octokit-4.22.0 lib/octokit/client/actions_workflows.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/octokit-4.21.0/lib/octokit/client/actions_workflows.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/octokit-4.21.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/octokit-4.21.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/octokit-4.21.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/octokit-4.21.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/octokit-4.20.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/octokit-4.20.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/octokit-4.19.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/octokit-4.20.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/octokit-4.19.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/octokit-4.21.0/lib/octokit/client/actions_workflows.rb
octokit-4.21.0 lib/octokit/client/actions_workflows.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/octokit-4.20.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/octokit-4.19.0/lib/octokit/client/actions_workflows.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/octokit-4.20.0/lib/octokit/client/actions_workflows.rb