aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin/GitHubCommit.hs
blob: 8fa8d0a3f4a24d385dc22e7ce80fd05780695afe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Plugin.GitHubCommit
    ( gitHubCommit
    ) where

import Text.Regex.TDFA

import qualified Message as M
import Plugin.Base

gitHubCommit = Plugin
    { matchRegex = "^[0-9a-f]{40}$"
    , perform = gitHubCommitAction
    }

gitHubCommitAction :: PluginAction
gitHubCommitAction message =
    "https://github.com/" ++ M.text message =~ matchRegex gitHubCommit