A Haskell library for the GitLab web API

Latest on Hackage:0.2.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

BSD-3-Clause licensed by Rob Stewart

This Haskell library queries and updates the database of a GitLab instance using the GitLab web API:

It also features an API for writing Gitlab file hook applications

Run all GitLab actions with runGitLab:

runGitLab :: (MonadUnliftIO m, MonadIO m)
 => GitLabServerConfig -- ^ the GitLab server details
 -> GitLab m a         -- ^ the GitLab action
 -> m a

For example:

myProjects <- runGitLab
         { url = ""
         , token="my_token"} )
     (searchUser "joe" >>= userProjects . fromJust)

Which uses the functions:

searchUser   :: Text -> GitLab m (Maybe User)
userProjects :: User -> GitLab m (Maybe [Project])

This library can also be used to develop rule based GitLab file hooks that react in real time to GitLab events with:

receive :: [Rule] -> GitLab ()
class (FromJSON a) => SystemHook a where
  match   :: String -> (a -> GitLab ()) -> Rule
  matchIf :: String -> (a -> GitLab Bool) -> (a -> GitLab ()) -> Rule

For more details about the file hooks support:

Unsurprisingly, this library is maintained on GitLab: