forked from haskell-github/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditIssue.hs
More file actions
22 lines (19 loc) · 802 Bytes
/
EditIssue.hs
File metadata and controls
22 lines (19 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE OverloadedStrings #-}
module EditIssue where
import qualified Github.Auth as Github
import qualified Github.Issues as Github
main = do
let auth = Github.BasicAuth "user" "password"
issueid = 3
edit = Github.editOfIssue { Github.editIssueState = Just "closed" }
possibleIssue <- Github.editIssue auth "thoughtbot" "paperclip" issueid edit
putStrLn $ either (\e -> "Error: " ++ show e)
formatIssue
possibleIssue
formatIssue issue =
(Github.githubOwnerLogin $ Github.issueUser issue) ++
" opened this issue " ++
(show $ Github.fromDate $ Github.issueCreatedAt issue) ++ "\n" ++
(Github.issueState issue) ++ " with " ++
(show $ Github.issueComments issue) ++ " comments" ++ "\n\n" ++
(Github.issueTitle issue)