mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-10-26 09:20:16 +03:00
b05e14d7fb
* Rerun tests between run attempts * without quotes * Bump up versions for hackage * Add support for auth github requests As anonymous ones reach the api limit quickly Via a unique argument with a github oauth token * Add changelog for 1.5.1 * Fix makrdownlint warnings * Bump up index state * Bump up plugin version * build with -v3 on error * More backjumps for tests and benchs * Add last prs * eval plugin needs ghcide>=1.5.0.1 * Include #2395 in the changelog * Ignore deferred tests for win and 9.0.1 * Ignore tactics tests for ubuntu+8.6.5
44 lines
1.6 KiB
Haskell
Executable File
44 lines
1.6 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
|
|
callCommand "git fetch --tags"
|
|
tags <- filter (isPrefixOf "1.") . lines <$>
|
|
readProcess "git" ["tag", "--list", "--sort=v:refname"] ""
|
|
|
|
lastDateStr <- last . lines <$> readProcess "git" ["show", "-s", "--format=%cI", "-1", last tags] ""
|
|
lastDate <- zonedTimeToUTC <$> iso8601ParseM lastDateStr
|
|
|
|
args <- getArgs
|
|
let githubReq = case args of
|
|
[] -> github'
|
|
token:_ -> github (OAuth $ BS.pack token)
|
|
prs <- githubReq $ pullRequestsForR "haskell" "haskell-language-server" stateClosed FetchAll
|
|
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)
|