|
| 1 | +## Organization / Secrets API |
| 2 | +[Back to the "Organization API"](../organization.md) | [Back to the navigation](../README.md) |
| 3 | + |
| 4 | +### List organization secrets |
| 5 | + |
| 6 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-organization-secrets |
| 7 | + |
| 8 | +```php |
| 9 | +$secrets = $client->organization()->secrets()->all('KnpLabs'); |
| 10 | +``` |
| 11 | + |
| 12 | +### Get an organization secret |
| 13 | + |
| 14 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-an-organization-secret |
| 15 | + |
| 16 | +```php |
| 17 | +$secret = $client->organization()->secrets()->show('KnpLabs', $secretName); |
| 18 | +``` |
| 19 | + |
| 20 | +### Create an organization secret |
| 21 | + |
| 22 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-or-update-an-organization-secret |
| 23 | + |
| 24 | +```php |
| 25 | +$client->organization()->secrets()->create('KnpLabs', $secretName, [ |
| 26 | + 'encrypted_value' => $encryptedValue, |
| 27 | + 'visibility' => $visibility, |
| 28 | + 'selected_repository_ids' => $selectedRepositoryIds, |
| 29 | +]); |
| 30 | +``` |
| 31 | + |
| 32 | +### Update an organization secret |
| 33 | + |
| 34 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#create-or-update-an-organization-secret |
| 35 | + |
| 36 | +```php |
| 37 | +$client->organization()->secrets()->update('KnpLabs', $secretName, [ |
| 38 | + 'key_id' => 'keyId', |
| 39 | + 'encrypted_value' => 'encryptedValue', |
| 40 | + 'visibility' => 'private', |
| 41 | +]); |
| 42 | +``` |
| 43 | + |
| 44 | +### Delete an organization secret |
| 45 | + |
| 46 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#delete-an-organization-secret |
| 47 | + |
| 48 | +```php |
| 49 | +$client->organization()->secrets()->remove('KnpLabs', $secretName); |
| 50 | +``` |
| 51 | + |
| 52 | +### List selected repositories for organization secret |
| 53 | + |
| 54 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-selected-repositories-for-an-organization-secret |
| 55 | + |
| 56 | +```php |
| 57 | +$client->organization()->secrets()->selectedRepositories('KnpLabs', $secretName); |
| 58 | +``` |
| 59 | + |
| 60 | +### Set selected repositories for an organization secret |
| 61 | + |
| 62 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#set-selected-repositories-for-an-organization-secret |
| 63 | + |
| 64 | +```php |
| 65 | +$client->organization()->secrets()->setSelectedRepositories('KnpLabs', 'secretName', [ |
| 66 | + 'selected_repository_ids' => [1, 2, 3], |
| 67 | +]); |
| 68 | +``` |
| 69 | + |
| 70 | +### Remove selected repository from an organization secret |
| 71 | + |
| 72 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#remove-selected-repository-from-an-organization-secret |
| 73 | + |
| 74 | +```php |
| 75 | +$client->organization()->secrets()->addSecret('KnpLabs', $repositoryId, $secretName); |
| 76 | +``` |
| 77 | + |
| 78 | +### Get an organization public key |
| 79 | + |
| 80 | +https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#get-an-organization-public-key |
| 81 | + |
| 82 | +```php |
| 83 | +$client->organization()->secrets()->publicKey('KnpLabs'); |
| 84 | +``` |
| 85 | + |
0 commit comments