123456789_123456789_123456789_123456789_123456789_

Module: Octokit::Client::DependabotSecrets

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/octokit/client/dependabot_secrets.rb

Overview

Methods for the dependabot Secrets API

Instance Method Summary

Instance Method Details

#create_or_update_dependabot_secret(repo, name, options)

Create or update secrets

Parameters:

  • repo (Integer, String, Hash, Repository)

    A GitHub repository

  • name (String)

    Name of secret

  • options (Hash)

    encrypted_value and key_id

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 75

def create_or_update_dependabot_secret(repo, name, options)
  put "#{Repository.path repo}/dependabot/secrets/#{name}", options
end

#create_or_update_org_dependabot_secret(org, name, options)

Create or update org secrets

Parameters:

  • org (String)

    A GitHub organization

  • name (String)

    Name of secret

  • options (Hash)

    encrypted_value and key_id

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 85

def create_or_update_org_dependabot_secret(org, name, options)
  put "#{Organization.path org}/dependabot/secrets/#{name}", options
end

#delete_dependabot_secret(repo, name)

Delete a secret

Parameters:

  • repo (Integer, String, Hash, Repository)

    A GitHub repository

  • name (String)

    Name of secret

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 94

def delete_dependabot_secret(repo, name)
  boolean_from_response :delete, "#{Repository.path repo}/dependabot/secrets/#{name}"
end

#delete_org_dependabot_secret(org, name)

Delete an org secret

Parameters:

  • org (String)

    A GitHub organization

  • name (String)

    Name of secret

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 103

def delete_org_dependabot_secret(org, name)
  boolean_from_response :delete, "#{Organization.path org}/dependabot/secrets/#{name}"
end

#get_dependabot_public_key(repo) ⇒ Hash

Get public key for secrets encryption

Parameters:

  • repo (Integer, String, Hash, Repository)

    A GitHub repository

Returns:

  • (Hash)

    key_id and key

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 14

def get_dependabot_public_key(repo)
  get "#{Repository.path repo}/dependabot/secrets/public-key"
end

#get_dependabot_secret(repo, name) ⇒ Hash

Get a secret

Parameters:

  • repo (Integer, String, Hash, Repository)

    A GitHub repository

  • name (String)

    Name of secret

Returns:

  • (Hash)

    name, created_at, updated_at, and visibility

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 55

def get_dependabot_secret(repo, name)
  get "#{Repository.path repo}/dependabot/secrets/#{name}"
end

#get_org_dependabot_public_key(org) ⇒ Hash

Get public key for secrets encryption

Parameters:

  • org (String)

    A GitHub organization

Returns:

  • (Hash)

    key_id and key

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 23

def get_org_dependabot_public_key(org)
  get "#{Organization.path org}/dependabot/secrets/public-key"
end

#get_org_dependabot_secret(org, name) ⇒ Hash

Get an org secret

Parameters:

  • org (String)

    A GitHub organization

  • name (String)

    Name of secret

Returns:

  • (Hash)

    name, created_at, updated_at, and visibility

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 65

def get_org_dependabot_secret(org, name)
  get "#{Organization.path org}/dependabot/secrets/#{name}"
end

#list_dependabot_secrets(repo) ⇒ Hash

List secrets

Parameters:

  • repo (Integer, String, Hash, Repository)

    A GitHub repository

Returns:

  • (Hash)

    total_count and list of secrets (each item is hash with name, created_at and updated_at)

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 32

def list_dependabot_secrets(repo)
  paginate "#{Repository.path repo}/dependabot/secrets" do |data, last_response|
    data.secrets.concat last_response.data.secrets
  end
end

#list_org_dependabot_secrets(org) ⇒ Hash

List org secrets

Parameters:

  • org (String)

    A GitHub organization

Returns:

  • (Hash)

    total_count and list of secrets (each item is hash with name, created_at and updated_at)

See Also:

[ GitHub ]

  
# File 'lib/octokit/client/dependabot_secrets.rb', line 43

def list_org_dependabot_secrets(org)
  paginate "#{Organization.path org}/dependabot/secrets" do |data, last_response|
    data.secrets.concat last_response.data.secrets
  end
end