From 80897c80905e354cdab3f093e54c51c85afdcb0d Mon Sep 17 00:00:00 2001 From: Mark Biek Date: Wed, 23 Dec 2015 14:40:45 -0500 Subject: [PATCH] Added examples for manipulating repository hooks --- doc/repos.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/repos.md b/doc/repos.md index 95cc76a310a..df504465804 100644 --- a/doc/repos.md +++ b/doc/repos.md @@ -136,6 +136,30 @@ $client->api('repo')->keys()->remove('username', 'reponame', 12345); Removes the key with id 12345 from the 'reponame' repository and returns a list of the deploy keys for the repository. +### Add a hook to a repository + +> Requires [authentication](security.md). + +```php +$client->api('repo')->hooks()->create('username', 'reponame', $params); +``` + +### Remove a hook from a repository + +> Requires [authentication](security.md). + +```php +$client->api('repo')->hooks()->remove('username', 'reponame', $id); +``` + +### Return a list of all hooks for the 'reponame' repository + +> Requires [authentication](security.md). + +```php +$client->api('repo')->hooks()->show('username', 'reponame'); +``` + ### Get the collaborators for a repository ```php