Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.58 KB

secrets.md

File metadata and controls

54 lines (36 loc) · 1.58 KB

Repo / Actions / Secrets API

Back to the "Repos API" | Back to the navigation

List repository secrets

https://docs.github.com/en/rest/reference/actions#list-repository-secrets

$secrets = $client->api('repo')->secrets()->all('KnpLabs', 'php-github-api');

Get a repository secret

https://docs.github.com/en/rest/reference/actions#get-a-repository-secret

$secret = $client->api('repo')->secrets()->show('KnpLabs', 'php-github-api', $secretName);

Create a repository secret

https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret

$client->api('repo')->secrets()->create('KnpLabs', 'php-github-api', $secretName, [
    'encrypted_value' => $encryptedValue,
]);                                                                                                     $client->api('repo')->secrets()->all();

Update a repository secret

https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret

$client->api('repo')->secrets()->update('KnpLabs', 'php-github-api', $secretName, [
    'key_id' => $keyId, 'encrypted_value' => $encryptedValue,
]);

Delete a repository secret

https://docs.github.com/en/rest/reference/actions#delete-a-repository-secret

$client->api('repo')->secrets()->remove('KnpLabs', 'php-github-api', $secretName);

Get a repository public key

https://docs.github.com/en/rest/reference/actions#get-a-repository-public-key

$publicKey = $client->api('repo')->secrets()->publicKey('KnpLabs', 'php-github-api');