From 9734d230e6c5e98f4bed1c86696de1b47c3c87fb Mon Sep 17 00:00:00 2001 From: Froxz Date: Thu, 9 Mar 2023 17:01:26 +0200 Subject: [PATCH 1/6] Deployment branch policies * added Deployment branch policies * Moved environments under deployment --- doc/README.md | 1 + doc/repo/environments.md | 8 +- doc/repo/policies.md | 38 ++++++ lib/Github/Api/Deployment.php | 18 +++ .../Environments.php} | 6 +- lib/Github/Api/Deployment/Policies.php | 108 ++++++++++++++++++ lib/Github/Client.php | 5 - .../EnvironmentsTest.php} | 6 +- .../Tests/Api/Deployment/PoliciesTest.php | 91 +++++++++++++++ test/Github/Tests/Api/DeploymentTest.php | 20 ++++ 10 files changed, 288 insertions(+), 13 deletions(-) create mode 100644 doc/repo/policies.md rename lib/Github/Api/{Environment.php => Deployment/Environments.php} (96%) create mode 100644 lib/Github/Api/Deployment/Policies.php rename test/Github/Tests/Api/{EnvironmentTest.php => Deployment/EnvironmentsTest.php} (92%) create mode 100644 test/Github/Tests/Api/Deployment/PoliciesTest.php diff --git a/doc/README.md b/doc/README.md index 3c1579f3269..6697980b1ca 100644 --- a/doc/README.md +++ b/doc/README.md @@ -59,6 +59,7 @@ v3 APIs: * [Check Suites](repo/check_suites.md) * [Contents](repo/contents.md) * [Deployments](repo/deployments.md) + * [Policies](repo/policies.md) * [Environments](repo/environments.md) * [Labels](repo/labels.md) * [Protection](repo/protection.md) diff --git a/doc/repo/environments.md b/doc/repo/environments.md index 56387ef8bfc..06619927e14 100644 --- a/doc/repo/environments.md +++ b/doc/repo/environments.md @@ -6,23 +6,23 @@ Provides information about environments for a repository. Wraps [GitHub Environm #### List all environments. ```php -$environments = $client->api('environment')->all('KnpLabs', 'php-github-api'); +$environments = $client->deployment()->environment()->all('KnpLabs', 'php-github-api'); ``` ### Get one environment. ```php -$environment = $client->api('environment')->show('KnpLabs', 'php-github-api', $name); +$environment = $client->deployment()->environment()->show('KnpLabs', 'php-github-api', $name); ``` #### Create or update environment. ```php -$data = $client->api('environment')->createOrUpdate('KnpLabs', 'php-github-api', $name); +$data = $client->deployment()->environment()->createOrUpdate('KnpLabs', 'php-github-api', $name); ``` #### Delete a existing environment. ```php -$environment = $client->api('environment')->remove('KnpLabs', 'php-github-api', $name); +$environment = $client->deployment()->environment()->remove('KnpLabs', 'php-github-api', $name); ``` diff --git a/doc/repo/policies.md b/doc/repo/policies.md new file mode 100644 index 00000000000..8a1aa7027b0 --- /dev/null +++ b/doc/repo/policies.md @@ -0,0 +1,38 @@ +## Repo / Deployment branch policies API +[Back to the "Repos API"](../repos.md) | [Back to the navigation](../index.md) + +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). + +#### List deployment branch policies. + +```php +$policies = $client->deployment()->policies()->all('KnpLabs', 'php-github-api', 'production'); +``` + +### Get one environment. + +```php +$policy = $client->deployment()->policies()->show('KnpLabs', 'php-github-api', 'production', $branchPolicyId); +``` + +#### Create policy. + +```php +$data = $client->deployment()->policies()->create('KnpLabs', 'php-github-api', 'production', [ + 'name' => 'name' +]); +``` + +#### Update policy. + +```php +$data = $client->deployment()->policies()->update('KnpLabs', 'php-github-api', 'production', $branchPolicyId, [ + 'name' => 'name' +]); +``` + +#### Delete a existing policy. + +```php +$policy = $client->deployment()->policies()->remove('KnpLabs', 'php-github-api', 'production', $branchPolicyId); +``` diff --git a/lib/Github/Api/Deployment.php b/lib/Github/Api/Deployment.php index f6127357ee9..1e80e3453e3 100644 --- a/lib/Github/Api/Deployment.php +++ b/lib/Github/Api/Deployment.php @@ -2,6 +2,8 @@ namespace Github\Api; +use Github\Api\Deployment\Policies; +use Github\Api\Deployment\Environments; use Github\Exception\MissingArgumentException; /** @@ -130,4 +132,20 @@ public function getStatuses($username, $repository, $id) { return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses'); } + + /** + * @return Environments + */ + public function environments() + { + return new Environments($this->getClient()); + } + + /** + * @return Policies + */ + public function policies() + { + return new Policies($this->getClient()); + } } diff --git a/lib/Github/Api/Environment.php b/lib/Github/Api/Deployment/Environments.php similarity index 96% rename from lib/Github/Api/Environment.php rename to lib/Github/Api/Deployment/Environments.php index 057d1edf0d8..b0d89c58996 100644 --- a/lib/Github/Api/Environment.php +++ b/lib/Github/Api/Deployment/Environments.php @@ -1,13 +1,15 @@ get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies', $params); + } + + /** + * Get a deployment branch policy + * + * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#get-a-deployment-branch-policy + * + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository + * @param string $environment the name of the environment. + * @param int $id The unique identifier of the branch policy. + * + * @return array + */ + public function show(string $username, string $repository, string $environment, int $id) + { + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies/'.$id); + } + + /** + * Creates a deployment branch policy for an environment. + * + * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy + * + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository + * @param string $environment the name of the environment. + * + * @throws MissingArgumentException + * + * @return array information about the deployment branch policy + */ + public function create(string $username, string $repository, string $environment, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException(['name']); + } + + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies', $params); + } + + /** + * Updates a deployment branch policy for an environment. + * + * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#update-a-deployment-branch-policy + * + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository + * @param string $environment the name of the environment. + * @param int $id The unique identifier of the branch policy. + * + * @return array information about the deployment branch policy + */ + public function update(string $username, string $repository, string $environment, int $id, array $params) + { + if (!isset($params['name'])) { + throw new MissingArgumentException(['name']); + } + + return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies/'.$id, $params); + } + + /** + * Delete a deployment branch policy + * + * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#delete-a-deployment-branch-policy + * + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository + * @param string $environment the name of the environment. + * @param int $id The unique identifier of the branch policy. + * + * @return mixed null on success, array on error with 'message' + */ + public function remove(string $username, string $repository, string $environment, int $id) + { + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies/'.$id); + } +} diff --git a/lib/Github/Client.php b/lib/Github/Client.php index c1eaa501faf..56d68d59cec 100644 --- a/lib/Github/Client.php +++ b/lib/Github/Client.php @@ -181,11 +181,6 @@ public function api($name): AbstractApi $api = new Api\Deployment($this); break; - case 'environment': - case 'environments': - $api = new Api\Environment($this); - break; - case 'ent': case 'enterprise': $api = new Api\Enterprise($this); diff --git a/test/Github/Tests/Api/EnvironmentTest.php b/test/Github/Tests/Api/Deployment/EnvironmentsTest.php similarity index 92% rename from test/Github/Tests/Api/EnvironmentTest.php rename to test/Github/Tests/Api/Deployment/EnvironmentsTest.php index 56efbc0afc8..637fa1b3c42 100644 --- a/test/Github/Tests/Api/EnvironmentTest.php +++ b/test/Github/Tests/Api/Deployment/EnvironmentsTest.php @@ -1,6 +1,8 @@ getApiMock(); + + $api->expects($this->once()) + ->method('post') + ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies'); + + $api->create('KnpLabs', 'php-github-api', 'production', [ + 'name' => 'name' + ]); + } + + /** + * @test + */ + public function shouldUpdatePolicy() + { + $api = $this->getApiMock(); + + $api->expects($this->once()) + ->method('put') + ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies/1'); + + $api->update('KnpLabs', 'php-github-api', 'production', 1, [ + 'name' => 'name' + ]); + } + + /** + * @test + */ + public function shouldGetAllPolicies() + { + $api = $this->getApiMock(); + $api->expects($this->once()) + ->method('get') + ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies'); + + $api->all('KnpLabs', 'php-github-api', 'production'); + } + + /** + * @test + */ + public function shouldShowPolicy() + { + $expectedValue = 'production'; + + $api = $this->getApiMock(); + $api->expects($this->once()) + ->method('get') + ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies/1') + ->will($this->returnValue($expectedValue)); + + $this->assertEquals($expectedValue, $api->show('KnpLabs', 'php-github-api', 'production', 1)); + } + + /** + * @test + */ + public function shouldDeletePolicy() + { + $api = $this->getApiMock(); + $api->expects($this->once()) + ->method('delete') + ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies/1') + ->will($this->returnValue(null)); + + $this->assertNull($api->remove('KnpLabs', 'php-github-api', 'production', 1)); + } + + /** + * @return string + */ + protected function getApiClass() + { + return \Github\Api\Deployment\Policies::class; + } +} diff --git a/test/Github/Tests/Api/DeploymentTest.php b/test/Github/Tests/Api/DeploymentTest.php index 88e8c923ce1..8741ee625f7 100644 --- a/test/Github/Tests/Api/DeploymentTest.php +++ b/test/Github/Tests/Api/DeploymentTest.php @@ -118,6 +118,26 @@ public function shouldGetAllStatuses() $api->getStatuses('KnpLabs', 'php-github-api', 1); } + /** + * @test + */ + public function shouldGetEnvironmentsApiObject() + { + $api = $this->getApiMock(); + + $this->assertInstanceOf(\Github\Api\Deployment\Environments::class, $api->environments()); + } + + /** + * @test + */ + public function shouldGetPoliciesApiObject() + { + $api = $this->getApiMock(); + + $this->assertInstanceOf(\Github\Api\Deployment\Policies::class, $api->policies()); + } + /** * @return string */ From c72fdae237d59aeb058d18850a7e3cb012a65197 Mon Sep 17 00:00:00 2001 From: Froxz Date: Fri, 10 Mar 2023 08:58:11 +0200 Subject: [PATCH 2/6] removed params validation --- lib/Github/Api/Deployment/Policies.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/Github/Api/Deployment/Policies.php b/lib/Github/Api/Deployment/Policies.php index e4ca3b8c66c..c1d5db78631 100644 --- a/lib/Github/Api/Deployment/Policies.php +++ b/lib/Github/Api/Deployment/Policies.php @@ -3,7 +3,6 @@ namespace Github\Api\Deployment; use Github\Api\AbstractApi; -use Github\Exception\MissingArgumentException; /** * Listing, creating and updating deployments. @@ -55,16 +54,10 @@ public function show(string $username, string $repository, string $environment, * @param string $repository the name of the repository * @param string $environment the name of the environment. * - * @throws MissingArgumentException - * * @return array information about the deployment branch policy */ public function create(string $username, string $repository, string $environment, array $params) { - if (!isset($params['name'])) { - throw new MissingArgumentException(['name']); - } - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies', $params); } @@ -82,10 +75,6 @@ public function create(string $username, string $repository, string $environment */ public function update(string $username, string $repository, string $environment, int $id, array $params) { - if (!isset($params['name'])) { - throw new MissingArgumentException(['name']); - } - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies/'.$id, $params); } From a61fe843d39a4fd48408bb1c167dd6c07cdf6bb6 Mon Sep 17 00:00:00 2001 From: Froxz Date: Fri, 10 Mar 2023 09:20:42 +0200 Subject: [PATCH 3/6] StyleCI fixes --- lib/Github/Api/Deployment.php | 2 +- lib/Github/Api/Deployment/Policies.php | 34 +++++++++---------- .../Tests/Api/Deployment/PoliciesTest.php | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/Github/Api/Deployment.php b/lib/Github/Api/Deployment.php index 1e80e3453e3..de5b0cb0eb9 100644 --- a/lib/Github/Api/Deployment.php +++ b/lib/Github/Api/Deployment.php @@ -2,8 +2,8 @@ namespace Github\Api; -use Github\Api\Deployment\Policies; use Github\Api\Deployment\Environments; +use Github\Api\Deployment\Policies; use Github\Exception\MissingArgumentException; /** diff --git a/lib/Github/Api/Deployment/Policies.php b/lib/Github/Api/Deployment/Policies.php index c1d5db78631..269db671c5b 100644 --- a/lib/Github/Api/Deployment/Policies.php +++ b/lib/Github/Api/Deployment/Policies.php @@ -12,14 +12,14 @@ class Policies extends AbstractApi { /** - * List deployment branch policies + * List deployment branch policies. * * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#list-deployment-branch-policies * - * @param string $username the username of the user who owns the repository - * @param string $repository the name of the repository + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository * @param string $environment the name of the environment. - * @param array $params query parameters to filter deployments by (see link) + * @param array $params query parameters to filter deployments by (see link) * * @return array the deployments requested */ @@ -29,14 +29,14 @@ public function all(string $username, string $repository, string $environment, a } /** - * Get a deployment branch policy + * Get a deployment branch policy. * * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#get-a-deployment-branch-policy * - * @param string $username the username of the user who owns the repository - * @param string $repository the name of the repository + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository * @param string $environment the name of the environment. - * @param int $id The unique identifier of the branch policy. + * @param int $id the unique identifier of the branch policy. * * @return array */ @@ -50,8 +50,8 @@ public function show(string $username, string $repository, string $environment, * * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#create-a-deployment-branch-policy * - * @param string $username the username of the user who owns the repository - * @param string $repository the name of the repository + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository * @param string $environment the name of the environment. * * @return array information about the deployment branch policy @@ -66,10 +66,10 @@ public function create(string $username, string $repository, string $environment * * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#update-a-deployment-branch-policy * - * @param string $username the username of the user who owns the repository - * @param string $repository the name of the repository + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository * @param string $environment the name of the environment. - * @param int $id The unique identifier of the branch policy. + * @param int $id the unique identifier of the branch policy. * * @return array information about the deployment branch policy */ @@ -79,14 +79,14 @@ public function update(string $username, string $repository, string $environment } /** - * Delete a deployment branch policy + * Delete a deployment branch policy. * * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#delete-a-deployment-branch-policy * - * @param string $username the username of the user who owns the repository - * @param string $repository the name of the repository + * @param string $username the username of the user who owns the repository + * @param string $repository the name of the repository * @param string $environment the name of the environment. - * @param int $id The unique identifier of the branch policy. + * @param int $id the unique identifier of the branch policy. * * @return mixed null on success, array on error with 'message' */ diff --git a/test/Github/Tests/Api/Deployment/PoliciesTest.php b/test/Github/Tests/Api/Deployment/PoliciesTest.php index a1935d0400e..6b387881ce7 100644 --- a/test/Github/Tests/Api/Deployment/PoliciesTest.php +++ b/test/Github/Tests/Api/Deployment/PoliciesTest.php @@ -18,7 +18,7 @@ public function shouldCreatePolicy() ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies'); $api->create('KnpLabs', 'php-github-api', 'production', [ - 'name' => 'name' + 'name' => 'name', ]); } @@ -34,7 +34,7 @@ public function shouldUpdatePolicy() ->with('/repos/KnpLabs/php-github-api/environments/production/deployment-branch-policies/1'); $api->update('KnpLabs', 'php-github-api', 'production', 1, [ - 'name' => 'name' + 'name' => 'name', ]); } From c30050c9c84eac1b81bddb0a9bb8f558b449f6c2 Mon Sep 17 00:00:00 2001 From: Froxz Date: Fri, 10 Mar 2023 09:23:08 +0200 Subject: [PATCH 4/6] styleCI fixes --- lib/Github/Api/Deployment/Policies.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Github/Api/Deployment/Policies.php b/lib/Github/Api/Deployment/Policies.php index 269db671c5b..e2d8fb59680 100644 --- a/lib/Github/Api/Deployment/Policies.php +++ b/lib/Github/Api/Deployment/Policies.php @@ -21,7 +21,7 @@ class Policies extends AbstractApi * @param string $environment the name of the environment. * @param array $params query parameters to filter deployments by (see link) * - * @return array the deployments requested + * @return array the branch policies requested */ public function all(string $username, string $repository, string $environment, array $params = []) { @@ -30,7 +30,7 @@ public function all(string $username, string $repository, string $environment, a /** * Get a deployment branch policy. - * + * * @link https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28#get-a-deployment-branch-policy * * @param string $username the username of the user who owns the repository @@ -87,7 +87,7 @@ public function update(string $username, string $repository, string $environment * @param string $repository the name of the repository * @param string $environment the name of the environment. * @param int $id the unique identifier of the branch policy. - * + * * @return mixed null on success, array on error with 'message' */ public function remove(string $username, string $repository, string $environment, int $id) From f657c3fd16a899b8c34294f028ebb739270618eb Mon Sep 17 00:00:00 2001 From: Froxz Date: Fri, 10 Mar 2023 13:25:28 +0200 Subject: [PATCH 5/6] StyleCi fixes --- lib/Github/Api/Deployment/Environments.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Github/Api/Deployment/Environments.php b/lib/Github/Api/Deployment/Environments.php index 57f6c34e291..191ec498eab 100644 --- a/lib/Github/Api/Deployment/Environments.php +++ b/lib/Github/Api/Deployment/Environments.php @@ -3,7 +3,6 @@ namespace Github\Api\Deployment; use Github\Api\AbstractApi; - use Github\Api\Environment\Secrets; use Github\Api\Environment\Variables; From d9f0195fa677a571314408f77a3b5779488816bf Mon Sep 17 00:00:00 2001 From: Froxz Date: Fri, 10 Mar 2023 13:35:25 +0200 Subject: [PATCH 6/6] Changes to docs --- doc/README.md | 8 ++++---- doc/{ => repo/deployments}/environment/secrets.md | 2 +- doc/{ => repo/deployments}/environment/variables.md | 2 +- doc/repo/{ => deployments}/environments.md | 4 ++-- doc/repo/{ => deployments}/policies.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename doc/{ => repo/deployments}/environment/secrets.md (92%) rename doc/{ => repo/deployments}/environment/variables.md (92%) rename doc/repo/{ => deployments}/environments.md (87%) rename doc/repo/{ => deployments}/policies.md (88%) diff --git a/doc/README.md b/doc/README.md index 04ad954c63b..cecccfb90b7 100644 --- a/doc/README.md +++ b/doc/README.md @@ -62,10 +62,10 @@ v3 APIs: * [Check Suites](repo/check_suites.md) * [Contents](repo/contents.md) * [Deployments](repo/deployments.md) - * [Secrets](environment/secrets.md) - * [Variables](environment/variables.md) - * [Policies](repo/policies.md) - * [Environments](repo/environments.md) + * [Policies](repo/deployments/policies.md) + * [Environments](repo/deployments/environments.md) + * [Secrets](repo/deployments/environment/secrets.md) + * [Variables](repo/deployments/environment/variables.md) * [Labels](repo/labels.md) * [Protection](repo/protection.md) * [Releases](repo/releases.md) diff --git a/doc/environment/secrets.md b/doc/repo/deployments/environment/secrets.md similarity index 92% rename from doc/environment/secrets.md rename to doc/repo/deployments/environment/secrets.md index a956945d61b..5c0c86b85d7 100644 --- a/doc/environment/secrets.md +++ b/doc/repo/deployments/environment/secrets.md @@ -1,5 +1,5 @@ ## Environment / Secrets API -[Back to the "Environments API"](../repo/environments.md) | [Back to the navigation](../README.md) +[Back to the "Environments API"](../environments.md) | [Back to the navigation](../README.md) ### List environment secrets diff --git a/doc/environment/variables.md b/doc/repo/deployments/environment/variables.md similarity index 92% rename from doc/environment/variables.md rename to doc/repo/deployments/environment/variables.md index d9de932589e..d645349a204 100644 --- a/doc/environment/variables.md +++ b/doc/repo/deployments/environment/variables.md @@ -1,5 +1,5 @@ ## Environment / Variables API -[Back to the "Environments API"](../repo/environments.md) | [Back to the navigation](../README.md) +[Back to the "Environments API"](../environments.md) | [Back to the navigation](../README.md) ### List environment variables diff --git a/doc/repo/environments.md b/doc/repo/deployments/environments.md similarity index 87% rename from doc/repo/environments.md rename to doc/repo/deployments/environments.md index 8420c5baf07..6cb409ae3b3 100644 --- a/doc/repo/environments.md +++ b/doc/repo/deployments/environments.md @@ -1,5 +1,5 @@ -## Repo / Environments API -[Back to the "Repos API"](../repos.md) | [Back to the navigation](../index.md) +## Deployment / Environments API +[Back to the "Deployment API"](../deployments.md) | [Back to the navigation](../index.md) Provides information about environments for a repository. Wraps [GitHub Environments API](https://docs.github.com/en/rest/deployments/environments?apiVersion=2022-11-28). diff --git a/doc/repo/policies.md b/doc/repo/deployments/policies.md similarity index 88% rename from doc/repo/policies.md rename to doc/repo/deployments/policies.md index 8a1aa7027b0..442fc0c4acb 100644 --- a/doc/repo/policies.md +++ b/doc/repo/deployments/policies.md @@ -1,5 +1,5 @@ -## Repo / Deployment branch policies API -[Back to the "Repos API"](../repos.md) | [Back to the navigation](../index.md) +## Deployment / Branch policies API +[Back to the "Deployment API"](../deployments.md) | [Back to the navigation](../index.md) 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).