OrganizationSecret

class github.OrganizationSecret.OrganizationSecret

This class represents a org level GitHub secret.

The reference can be found here https://docs.github.com/en/rest/actions/secrets

The OpenAPI schema can be found at

  • /components/schemas/organization-actions-secret

A CompletableGithubObject can be partially initialised (completed=False). Accessing attributes that are not initialized will then trigger a request to complete all attributes.

A partially initialized CompletableGithubObject (completed=False) can be completed via complete(). This requires the url to be given via parameter url or attributes.

With a requester where Requester.is_lazy == True, this CompletableGithubObjects is partially initialized. This requires the url to be given via parameter url or attributes. Any CompletableGithubObject created from this lazy object will be lazy itself if created with parameter url or attributes.

Parameters:
  • requester – requester

  • headers – response headers

  • attributes – attributes to initialize

  • completed – do not update non-initialized attributes when True

  • url – url of this instance, overrides attributes[‘url’]

  • accept – use this accept header when completing this instance

property visibility: str
Type:

string

edit(value: str, visibility: str = 'all', secret_type: str = 'actions', selected_repositories: Opt[list[Repository]] = NotSet) → bool
Calls:

PUT /orgs/{org}/actions/secrets/{secret_name}

Calls:

PUT /orgs/{org}/dependabot/secrets/{secret_name}

Parameters:
  • value – string plain text value of the secret

  • visibility – string options all, private or selected

  • secret_type – string options actions or dependabot

  • selected_repositories – list of github.Repository.Repository

Return type:

bool

get_public_key(secret_type: str = 'actions') → PublicKey
Calls:

GET /orgs/{org}/actions/secrets/public-key

Calls:

GET /orgs/{org}/dependabot/secrets/public-key

Parameters:

secret_type – string options actions or dependabot

Return type:

github.PublicKey.PublicKey

add_repo(repo: Repository) → bool
Calls:

PUT /orgs/{org}/actions/secrets/{secret_name}

Parameters:

repo – github.Repository.Repository

Return type:

bool

remove_repo(repo: Repository) → bool
Calls:

DELETE /orgs/{org}/actions/secrets/{secret_name}

Parameters:

repo – github.Repository.Repository

Return type:

bool