1module GithubIssue (mkIssueContent) where
4import Data.Array (intercalate)
7import Data.Tuple (Tuple(..))
8import Github (IssueContent)
9import PackageSets (Package)
10import VersionCompare (VersionComparison)
12-- | Create the content of the github issue shows the current state
13-- | It contains the packages that can be updated
14-- | The state can be 'open' or 'closed' (github api)
15mkIssueContent :: Map Package VersionComparison -> IssueContent
16mkIssueContent packageComparison = { title, body, state }
18 state = if M.isEmpty packageComparison then "closed" else "open"
20 title = "Version Check: " <> summary
23 if M.isEmpty packageComparison then
24 "All packages up-to-date ✔️"
26 (show $ M.size packageComparison) <> " package(s) ⚠️"
28 body = intercalate "\n\n" $ [ packages, explainer ]
34 <> intercalate "\n" packageLines
36 packageLines :: Array String
38 Tuple k v <- M.toUnfoldable packageComparison
39 pure $ "* " <> show k <> " " <> show v
42 "# About this Issue\n\n"
43 <> "This issue is **updated automatically**. "
44 <> "It can be closed and will be re-opened in case there are new updates available.\n\n"
45 <> "See <https://github.com/purescript/package-sets/tree/master/ci>"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list