Skip to content

Commit 91cbb4c

Browse files
Thomas M. DuBuissonphadej
authored andcommitted
Provide a wrapper for forking outside of the Req monad.
1 parent 3e768ad commit 91cbb4c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/GitHub/Endpoints/Repos.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module GitHub.Endpoints.Repos (
3838
createRepoR,
3939
createOrganizationRepo',
4040
createOrganizationRepoR,
41+
forkExistingRepo',
4142
forkExistingRepoR,
4243

4344
-- ** Edit
@@ -167,6 +168,11 @@ createRepoR :: NewRepo -> Request 'RW Repo
167168
createRepoR nrepo =
168169
command Post ["user", "repos"] (encode nrepo)
169170

171+
-- | Fork an existing repository.
172+
forkExistingRepo' :: Auth -> Name Owner -> Name Repo -> Maybe (Name Owner) -> IO (Either Error Repo)
173+
forkExistingRepo' auth owner repo morg =
174+
executeRequest auth $ forkExistingRepoR owner repo morg
175+
170176
-- | Fork an existing repository.
171177
-- See <https://developer.github.com/v3/repos/forks/#create-a-fork>
172178
-- TODO: The third paramater (an optional Organisation) is not used yet.

0 commit comments

Comments
 (0)