module Octokit::Client::ActionsSecrets
Methods for the Actions Secrets API
Public Instance Methods
Create or update an environment secret
@param repo [Integer, String, Hash, Repository] A GitHub repository @param environment [String] Name of environment @param name [String] Name of secret @param options [Hash] encrypted_value and key_id @see docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret
# File lib/octokit/client/actions_secrets.rb, line 147 def create_or_update_actions_environment_secret(repo, environment, name, options) put "#{Repository.path repo}/environments/#{environment}/secrets/#{name}", options end
Create or update secrets
@param repo [Integer, String, Hash, Repository] A GitHub repository @param name [String] Name of secret @param options [Hash] encrypted_value and key_id @see developer.github.com/v3/actions/secrets/#create-or-update-a-secret-for-a-repository
# File lib/octokit/client/actions_secrets.rb, line 75 def create_or_update_actions_secret(repo, name, options) put "#{Repository.path repo}/actions/secrets/#{name}", options end
Create or update org secrets
@param org [String] A GitHub organization @param name [String] Name of secret @param options [Hash] encrypted_value and key_id @see developer.github.com/v3/actions/secrets/#create-or-update-a-secret
# File lib/octokit/client/actions_secrets.rb, line 85 def create_or_update_org_actions_secret(org, name, options) put "#{Organization.path org}/actions/secrets/#{name}", options end
Delete environment secret @param repo [Integer, String, Hash, Repository] A GitHub repository @param environment [String] Name of environment @param name [String] Name of secret @see docs.github.com/en/rest/actions/secrets#delete-an-environment-secret
# File lib/octokit/client/actions_secrets.rb, line 156 def delete_actions_environment_secret(repo, environment, name) boolean_from_response :delete, "#{Repository.path repo}/environments/#{environment}/secrets/#{name}" end
Delete a secret
@param repo [Integer, String, Hash, Repository] A GitHub repository @param name [String] Name of secret @see developer.github.com/v3/actions/secrets/#delete-a-secret-from-a-repository
# File lib/octokit/client/actions_secrets.rb, line 94 def delete_actions_secret(repo, name) boolean_from_response :delete, "#{Repository.path repo}/actions/secrets/#{name}" end
Delete an org secret
@param org [String] A GitHub organization @param name [String] Name of secret @see developer.github.com/v3/actions/secrets/#delete-a-secret
# File lib/octokit/client/actions_secrets.rb, line 103 def delete_org_actions_secret(org, name) boolean_from_response :delete, "#{Organization.path org}/actions/secrets/#{name}" end
Get environment public key for secrets encryption
@param repo [Integer, String, Hash, Repository] A GitHub repository @param environment [String] Name of environment @return [Hash] key_id and key @see docs.github.com/en/rest/actions/secrets#get-an-environment-public-key
# File lib/octokit/client/actions_secrets.rb, line 113 def get_actions_environment_public_key(repo, environment) get "#{Repository.path repo}/environments/#{environment}/secrets/public-key" end
Get an environment secret
@param repo [Integer, String, Hash, Repository] A GitHub repository @param environment [String] Name of environment @param name [String] Name of secret @return [Hash] name, created_at and updated_at @see docs.github.com/en/rest/actions/secrets#get-an-environment-secret
# File lib/octokit/client/actions_secrets.rb, line 136 def get_actions_environment_secret(repo, environment, name) get "#{Repository.path repo}/environments/#{environment}/secrets/#{name}" end
Get public key for secrets encryption
@param repo [Integer, String, Hash, Repository] A GitHub repository @return [Hash] key_id and key @see developer.github.com/v3/actions/secrets/#get-your-public-key
# File lib/octokit/client/actions_secrets.rb, line 14 def get_actions_public_key(repo) get "#{Repository.path repo}/actions/secrets/public-key" end
Get a secret
@param repo [Integer, String, Hash, Repository] A GitHub repository @param name [String] Name of secret @return [Hash] name, created_at and updated_at @see developer.github.com/v3/actions/secrets/#get-a-secret
# File lib/octokit/client/actions_secrets.rb, line 55 def get_actions_secret(repo, name) get "#{Repository.path repo}/actions/secrets/#{name}" end
Get public key for secrets encryption
@param org [String] A GitHub organization @return [Hash] key_id and key @see developer.github.com/v3/actions/secrets/#get-your-public-key
# File lib/octokit/client/actions_secrets.rb, line 23 def get_org_actions_public_key(org) get "#{Organization.path org}/actions/secrets/public-key" end
Get an org secret
@param org [String] A GitHub organization @param name [String] Name of secret @return [Hash] name, created_at and updated_at @see developer.github.com/v3/actions/secrets/#get-a-secret
# File lib/octokit/client/actions_secrets.rb, line 65 def get_org_actions_secret(org, name) get "#{Organization.path org}/actions/secrets/#{name}" end
List environment secrets
@param repo [Integer, String, Hash, Repository] A GitHub repository @param environment [String] Name of environment @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) @see developer.github.com/v3/actions/secrets/#list-environment-secrets
# File lib/octokit/client/actions_secrets.rb, line 123 def list_actions_environment_secrets(repo, environment) paginate "#{Repository.path repo}/environments/#{environment}/secrets" do |data, last_response| data.secrets.concat last_response.data.secrets end end
List secrets
@param repo [Integer, String, Hash, Repository] A GitHub repository @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) @see developer.github.com/v3/actions/secrets/#list-secrets-for-a-repository
# File lib/octokit/client/actions_secrets.rb, line 32 def list_actions_secrets(repo) paginate "#{Repository.path repo}/actions/secrets" do |data, last_response| data.secrets.concat last_response.data.secrets end end
List org secrets
@param org [String] A GitHub organization @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) @see developer.github.com/v3/actions/secrets/#list-organization-secrets
# File lib/octokit/client/actions_secrets.rb, line 43 def list_org_actions_secrets(org) paginate "#{Organization.path org}/actions/secrets" do |data, last_response| data.secrets.concat last_response.data.secrets end end