Skip to content

Commit dc27d81

Browse files
committed
Add deployments to GitHub
1 parent 855cefe commit dc27d81

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

src/GitHub.hs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ module GitHub (
259259
--
260260
-- * Create a commit comment
261261
-- * Update a commit comment
262-
-- * Delete a commit comment
262+
-- * Delete a commit comment
263263
commentsForR,
264264
commitCommentsForR,
265265
commitCommentForR,
@@ -271,6 +271,18 @@ module GitHub (
271271
commitR,
272272
diffR,
273273

274+
-- ** Deployments
275+
-- | See <https://developer.github.com/v3/repos/deployments/#deployments>
276+
--
277+
-- Missing endpoints:
278+
-- * Get a single deployment
279+
-- * Update a deployment
280+
-- * Get a single deployment status
281+
deploymentsWithOptionsForR,
282+
createDeploymentR,
283+
deploymentStatusesForR,
284+
createDeploymentStatusR,
285+
274286
-- ** Forks
275287
-- | See <https://developer.github.com/v3/repos/forks/>
276288
--
@@ -344,7 +356,7 @@ module GitHub (
344356
createStatusR,
345357
statusesForR,
346358
statusForR,
347-
359+
348360
-- ** Rate Limit
349361
-- | See <https://developer.github.com/v3/rate_limit/>
350362
rateLimit,
@@ -375,13 +387,14 @@ import GitHub.Endpoints.Organizations
375387
import GitHub.Endpoints.Organizations.Members
376388
import GitHub.Endpoints.Organizations.Teams
377389
import GitHub.Endpoints.PullRequests
378-
import GitHub.Endpoints.PullRequests.Reviews
379390
import GitHub.Endpoints.PullRequests.Comments
391+
import GitHub.Endpoints.PullRequests.Reviews
380392
import GitHub.Endpoints.RateLimit
381393
import GitHub.Endpoints.Repos
382394
import GitHub.Endpoints.Repos.Collaborators
383395
import GitHub.Endpoints.Repos.Comments
384396
import GitHub.Endpoints.Repos.Commits
397+
import GitHub.Endpoints.Repos.Deployments
385398
import GitHub.Endpoints.Repos.Forks
386399
import GitHub.Endpoints.Repos.Releases
387400
import GitHub.Endpoints.Repos.Statuses

src/GitHub/Endpoints/Repos/Deployments.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE LambdaCase #-}
2-
31
-- | The deployments API, as described at <https://developer.github.com/v3/repos/deployments/>
42
module GitHub.Endpoints.Repos.Deployments
53
( deploymentsWithOptionsForR
@@ -18,6 +16,8 @@ import Data.Vector (Vector)
1816
import GitHub.Data
1917
import GitHub.Internal.Prelude
2018

19+
-- | List deployments.
20+
-- See <https://developer.github.com/v3/repos/deployments/#list-deployments>
2121
deploymentsWithOptionsForR
2222
:: FromJSON a
2323
=> Name Owner
@@ -30,6 +30,8 @@ deploymentsWithOptionsForR owner repo limit opts =
3030
(map (second Just . renderDeploymentQueryOption) opts)
3131
limit
3232

33+
-- | Create a deployment.
34+
-- See <https://developer.github.com/v3/repos/deployments/#create-a-deployment>
3335
createDeploymentR
3436
:: ( ToJSON a
3537
, FromJSON a
@@ -41,6 +43,8 @@ createDeploymentR
4143
createDeploymentR owner repo =
4244
command Post (deployPaths owner repo) . encode
4345

46+
-- | List deployment statuses.
47+
-- See <https://developer.github.com/v3/repos/deployments/#list-deployment-statuses>
4448
deploymentStatusesForR
4549
:: Name Owner
4650
-> Name Repo
@@ -50,6 +54,8 @@ deploymentStatusesForR
5054
deploymentStatusesForR owner repo deploy =
5155
pagedQuery (statusesPaths owner repo deploy) []
5256

57+
-- | Create a deployment status.
58+
-- See <https://developer.github.com/v3/repos/deployments/#list-deployment-statuses>
5359
createDeploymentStatusR
5460
:: Name Owner
5561
-> Name Repo

0 commit comments

Comments
 (0)