mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-09-17 11:47:09 +03:00
9c56c3c0c6
* Prepare release 2.1.0.0 * Update release ghc versions * Fix release CI for unknown linux * Generate ChangeLog from 2.0.0.0 * Update notable changes in ChangeLog * Update index-state * Add environment for vars context * Free up disk space after running test * Expand release notes * Update supported ghc version page --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
39 lines
1.4 KiB
Haskell
Executable File
39 lines
1.4 KiB
Haskell
Executable File
#!/usr/bin/env cabal
|
|
{- cabal:
|
|
build-depends: base, bytestring, process, text, github, time >= 1.9
|
|
-}
|
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
{-# LANGUAGE RecordWildCards #-}
|
|
|
|
import Control.Monad
|
|
import qualified Data.ByteString.Char8 as BS
|
|
import Data.List
|
|
import Data.Maybe
|
|
import qualified Data.Text as T
|
|
import Data.Time.Format.ISO8601
|
|
import Data.Time.LocalTime
|
|
import GitHub
|
|
import System.Environment
|
|
import System.Process
|
|
|
|
main = do
|
|
args <- getArgs
|
|
let (githubReq,tag) = case args of
|
|
token:tag:_ -> (github (OAuth $ BS.pack token), tag)
|
|
prs <- githubReq $ pullRequestsForR "haskell" "haskell-language-server" stateClosed FetchAll
|
|
lastDateStr <- last . lines <$> readProcess "git" ["show", "-s", "--format=%cI", "-1", tag] ""
|
|
lastDate <- zonedTimeToUTC <$> iso8601ParseM lastDateStr
|
|
|
|
let prsAfterLastTag = either (error . show)
|
|
(foldMap (\pr -> [pr | inRange pr]))
|
|
prs
|
|
inRange pr
|
|
| Just mergedDate <- simplePullRequestMergedAt pr = mergedDate > lastDate
|
|
| otherwise = False
|
|
|
|
forM_ prsAfterLastTag $ \SimplePullRequest{..} ->
|
|
putStrLn $ T.unpack $ "- " <> simplePullRequestTitle <>
|
|
"\n ([#" <> T.pack (show $ unIssueNumber simplePullRequestNumber) <> "](" <> getUrl simplePullRequestHtmlUrl <> "))" <>
|
|
" by @" <> untagName (simpleUserLogin simplePullRequestUser)
|