Module: DroneCI::SecretsAPI

Included in:
API
Defined in:
lib/drone-ci/api/secrets.rb

Instance Method Summary collapse

Instance Method Details

#secret_create(owner, repo, **body) ⇒ Object

Create a new repository secret.

Please note this api requires write access to the repository.

Reference: docs.drone.io/api/secrets/secret_create/



10
11
12
# File 'lib/drone-ci/api/secrets.rb', line 10

def secret_create(owner, repo, **body)
  api.post("repos/#{owner}/#{repo}/secrets", body)
end

#secret_delete(owner, repo, secret) ⇒ Object

Deletes a repository secret.

Please note this api requires write access to the repository, and the request parameter secret is not the secret’s id but secret name.

Reference: docs.drone.io/api/secrets/secret_delete/



19
20
21
# File 'lib/drone-ci/api/secrets.rb', line 19

def secret_delete(owner, repo, secret)
  api.post("repos/#{owner}/#{repo}/secrets/#{secret}")
end

#secret_info(owner, repo, secret) ⇒ Object

Returns the repository secret.

Please note this api requires write access to the repository, and the request parameter secret is not the secret’s id but secret name.

Reference: docs.drone.io/api/secrets/secret_info/



28
29
30
# File 'lib/drone-ci/api/secrets.rb', line 28

def secret_info(owner, repo, secret)
  api.get("repos/#{owner}/#{repo}/secrets/#{secret}")
end

#secret_list(owner, repo) ⇒ Object

Returns the repository secret list.

Please note this api requires write access to the repository.

Reference: docs.drone.io/api/secrets/secret_list/



37
38
39
# File 'lib/drone-ci/api/secrets.rb', line 37

def secret_list(owner, repo)
  api.get("repos/#{owner}/#{repo}/secrets")
end

#secret_update(owner, repo, secret, **body) ⇒ Object

Updates the specified repository secret.

Please note this api requires write access to the repository, and the request parameter secret is not the secret’s id but secret name.

Reference: docs.drone.io/api/secrets/secret_update/



46
47
48
# File 'lib/drone-ci/api/secrets.rb', line 46

def secret_update(owner, repo, secret, **body)
  api.patch("repos/#{owner}/#{repo}/secrets/#{secret}", body)
end