Skip to content

Commit 50a0ee1

Browse files
authored
Merge branch 'master' into master
2 parents 70e7bbe + c68b874 commit 50a0ee1

File tree

28 files changed

+1535
-40
lines changed

28 files changed

+1535
-40
lines changed

CHANGELOG-3.X.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 3.11.0
4+
5+
### Added
6+
- Added environment variables & secrets ([Froxz](https://github.com/Froxz)) [#1104](https://github.com/KnpLabs/php-github-api/issues/1104)
7+
- Added Org & Repository variables ([Froxz](https://github.com/Froxz)) [#1106](https://github.com/KnpLabs/php-github-api/issues/1106)
8+
- Deployment branch policies ([Froxz](https://github.com/Froxz)) [#1108](https://github.com/KnpLabs/php-github-api/issues/1108)
9+
10+
### Changed
11+
- Test on PHP 8.2 ([GrahamCampbell](https://github.com/GrahamCampbell)) [#1105](https://github.com/KnpLabs/php-github-api/issues/1105)
12+
13+
### Fixed
14+
- Bugfix creating env ([Froxz](https://github.com/Froxz)) [#1107](https://github.com/KnpLabs/php-github-api/issues/1107)
15+
316
## 3.10.0
417

518
### Added

doc/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ v3 APIs:
3939
* [Organization](organization.md)
4040
* [Members](organization/members.md)
4141
* [Teams](organization/teams.md)
42-
* Actions
43-
* [Self hosted runners](organization/actions/self_hosted_runners.md)
42+
* [Self hosted runners](organization/actions/self_hosted_runners.md)
43+
* [Secrets](organization/actions/secrets.md)
44+
* [Variables](organization/actions/variables.md)
4445
* [Projects](project/projects.md)
4546
* [Columns](project/columns.md)
4647
* [Cards](project/cards.md)
@@ -53,6 +54,7 @@ v3 APIs:
5354
* Actions
5455
* [Artifacts](repo/actions/artifacts.md)
5556
* [Secrets](repo/actions/secrets.md)
57+
* [Variables](repo/actions/variables.md)
5658
* [Self hosted runners](repo/actions/self_hosted_runners.md)
5759
* [Workflow jobs](repo/actions/workflow_jobs.md)
5860
* [Workflow runs](repo/actions/workflow_runs.md)
@@ -61,7 +63,10 @@ v3 APIs:
6163
* [Check Suites](repo/check_suites.md)
6264
* [Contents](repo/contents.md)
6365
* [Deployments](repo/deployments.md)
64-
* [Environments](repo/environments.md)
66+
* [Policies](repo/deployments/policies.md)
67+
* [Environments](repo/deployments/environments.md)
68+
* [Secrets](repo/deployments/environment/secrets.md)
69+
* [Variables](repo/deployments/environment/variables.md)
6570
* [Labels](repo/labels.md)
6671
* [Protection](repo/protection.md)
6772
* [Releases](repo/releases.md)

doc/organization/actions/variables.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
## Organization / Variables API
2+
[Back to the "Organization API"](../organization.md) | [Back to the navigation](../README.md)
3+
4+
### List organization variables
5+
6+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-organization-variables
7+
8+
```php
9+
$variables = $client->organization()->variables()->all('KnpLabs');
10+
```
11+
12+
### Get an organization variable
13+
14+
https://docs.github.com/en/rest/reference/actions#get-an-organization-secret
15+
16+
```php
17+
$variable = $client->organization()->variables()->show('KnpLabs', $variableName);
18+
```
19+
20+
### Create an organization variable
21+
22+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-organization-variable
23+
24+
```php
25+
$client->organization()->variables()->create('KnpLabs', [
26+
'name' => $name,
27+
'value' => $value,
28+
'visibility' => $visibility,
29+
'selected_repository_ids' => $selectedRepositoryIds,
30+
]);
31+
```
32+
33+
### Update an organization variable
34+
35+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-organization-variable
36+
37+
```php
38+
$client->organization()->variables()->update('KnpLabs', $variableName, [
39+
'name' => $name,
40+
'value' => $value,
41+
'visibility' => $visibility,
42+
'selected_repository_ids' => $selectedRepositoryIds
43+
]);
44+
```
45+
46+
### Delete an organization variable
47+
48+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-organization-variable
49+
50+
```php
51+
$client->organization()->variables()->remove('KnpLabs', $variableName);
52+
```
53+
54+
### List selected repositories for organization variable
55+
56+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-selected-repositories-for-an-organization-variable
57+
58+
```php
59+
$client->organization()->variables()->selectedRepositories('KnpLabs', $variableName);
60+
```
61+
62+
### Set selected repositories for an organization variable
63+
64+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#set-selected-repositories-for-an-organization-variable
65+
66+
```php
67+
$client->organization()->variables()->setSelectedRepositories('KnpLabs', 'variableName', [
68+
'selected_repository_ids' => [1, 2, 3],
69+
]);
70+
```
71+
72+
### Add selected repository to an organization variable
73+
74+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#add-selected-repository-to-an-organization-variable
75+
76+
```php
77+
$client->organization()->variables()->addRepository('KnpLabs', $repositoryId, $variableName);
78+
```
79+
80+
### Remove selected repository from an organization variable
81+
82+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#remove-selected-repository-from-an-organization-variable
83+
84+
```php
85+
$client->organization()->variables()->removeRepository('KnpLabs', $repositoryId, $variableName);
86+
```
87+

doc/repo/actions/variables.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Repo / Actions / Variables API
2+
[Back to the "Repos API"](../../repos.md) | [Back to the navigation](../../README.md)
3+
4+
### List repository variables
5+
6+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-repository-variables
7+
8+
```php
9+
$variables = $client->api('repo')->variables()->all('KnpLabs', 'php-github-api');
10+
```
11+
12+
### Get a repository variable
13+
14+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-a-repository-variable
15+
16+
```php
17+
$variable = $client->api('repo')->variables()->show('KnpLabs', 'php-github-api', $variableName);
18+
```
19+
20+
### Create a repository variable
21+
22+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-a-repository-variable
23+
24+
```php
25+
$client->api('repo')->variables()->create('KnpLabs', 'php-github-api', [
26+
'name' => $name,
27+
'value' => $value,
28+
]);
29+
```
30+
31+
### Update a repository variable
32+
33+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-a-repository-variable
34+
35+
```php
36+
$client->api('repo')->variables()->update('KnpLabs', 'php-github-api', $variableName, [
37+
'name' => $name,
38+
'value' => $value,
39+
]);
40+
```
41+
42+
### Delete a repository variable
43+
44+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-a-repository-variable
45+
46+
```php
47+
$client->api('repo')->variables()->remove('KnpLabs', 'php-github-api', $variableName);
48+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Environment / Secrets API
2+
[Back to the "Environments API"](../environments.md) | [Back to the navigation](../README.md)
3+
4+
### List environment secrets
5+
6+
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28
7+
8+
```php
9+
$secrets = $client->environment()->secrets()->all($repoId, $envName);
10+
```
11+
12+
### Get an environment secret
13+
14+
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#get-an-environment-secret
15+
16+
```php
17+
$secret = $client->environment()->secrets()->show($repoId, $envName, $secretName);
18+
```
19+
20+
### Create or Update an environment secret
21+
22+
https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-environment-secret
23+
24+
```php
25+
$client->environment()->secrets()->createOrUpdate($repoId, $envName, $secretName, [
26+
'encrypted_value' => $encryptedValue,
27+
'key_id' => $key_id
28+
]);
29+
```
30+
31+
### Delete an environment secret
32+
33+
https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret
34+
35+
```php
36+
$client->environment()->secrets()->remove($repoId, $envName, $secretName);
37+
```
38+
39+
### Get an environment public key
40+
41+
https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key
42+
43+
```php
44+
$client->environment()->secrets()->publicKey($repoId, $envName);
45+
```
46+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Environment / Variables API
2+
[Back to the "Environments API"](../environments.md) | [Back to the navigation](../README.md)
3+
4+
### List environment variables
5+
6+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#list-environment-variables
7+
8+
```php
9+
$variables = $client->environment()->variables()->all($repoId, $envName);
10+
```
11+
12+
### Get an environment variable
13+
14+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#get-an-environment-variable
15+
16+
```php
17+
$variable = $client->environment()->variables()->show($repoId, $envName, $variableName);
18+
```
19+
20+
### Create environment variable
21+
22+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#create-an-environment-variable
23+
24+
```php
25+
$client->environment()->variables()->create($repoId, $envName, [
26+
'name' => $name,
27+
'value' => $value
28+
]);
29+
```
30+
31+
### Update environment variable
32+
33+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#update-an-environment-variable
34+
35+
```php
36+
$client->environment()->variables()->update($repoId, $envName, $variableName, [
37+
'name' => $name,
38+
'value' => $value
39+
]);
40+
```
41+
42+
### Delete an environment variable
43+
44+
https://docs.github.com/en/rest/actions/variables?apiVersion=2022-11-28#delete-an-environment-variable
45+
46+
```php
47+
$client->environment()->variables()->remove($repoId, $envName, $variableName);
48+
```
49+

doc/repo/deployments/environments.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Deployment / Environments API
2+
[Back to the "Deployment API"](../deployments.md) | [Back to the navigation](../index.md)
3+
4+
Provides information about environments for a repository. Wraps [GitHub Environments API](https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28).
5+
6+
Additional APIs:
7+
* [Secrets API](environment/secrets.md)
8+
* [Variables API](environment/variables.md)
9+
10+
#### List all environments.
11+
12+
```php
13+
$environments = $client->deployment()->environment()->all('KnpLabs', 'php-github-api');
14+
```
15+
16+
### Get one environment.
17+
18+
```php
19+
$environment = $client->deployment()->environment()->show('KnpLabs', 'php-github-api', $name);
20+
```
21+
22+
#### Create or update environment.
23+
24+
```php
25+
$data = $client->deployment()->environment()->createOrUpdate('KnpLabs', 'php-github-api', $name);
26+
```
27+
28+
#### Delete a existing environment.
29+
30+
```php
31+
$environment = $client->deployment()->environment()->remove('KnpLabs', 'php-github-api', $name);
32+
```

doc/repo/deployments/policies.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Deployment / Branch policies API
2+
[Back to the "Deployment API"](../deployments.md) | [Back to the navigation](../index.md)
3+
4+
Provides information about deployment branch policies. Wraps [GitHub Deployment branch policies API](https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#about-deployment-branch-policies).
5+
6+
#### List deployment branch policies.
7+
8+
```php
9+
$policies = $client->deployment()->policies()->all('KnpLabs', 'php-github-api', 'production');
10+
```
11+
12+
### Get one environment.
13+
14+
```php
15+
$policy = $client->deployment()->policies()->show('KnpLabs', 'php-github-api', 'production', $branchPolicyId);
16+
```
17+
18+
#### Create policy.
19+
20+
```php
21+
$data = $client->deployment()->policies()->create('KnpLabs', 'php-github-api', 'production', [
22+
'name' => 'name'
23+
]);
24+
```
25+
26+
#### Update policy.
27+
28+
```php
29+
$data = $client->deployment()->policies()->update('KnpLabs', 'php-github-api', 'production', $branchPolicyId, [
30+
'name' => 'name'
31+
]);
32+
```
33+
34+
#### Delete a existing policy.
35+
36+
```php
37+
$policy = $client->deployment()->policies()->remove('KnpLabs', 'php-github-api', 'production', $branchPolicyId);
38+
```

doc/repo/environments.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)