Created
July 18, 2024 15:31
-
-
Save chrisdone-artificial/56654426d4057853f12123162664d98c to your computer and use it in GitHub Desktop.
cc.hell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env hell | |
-- Check all the prefixes and permitted delimiters against | |
-- <https://www.conventionalcommits.org/en/v1.0.0/> | |
main = do | |
title <- Environment.getEnv "PR_TITLE" | |
if List.or $ | |
List.map (\prefix -> | |
List.or [ | |
Text.isPrefixOf (Text.concat [prefix, ": "]) title, | |
Text.isPrefixOf (Text.concat [prefix, "("]) title, | |
Text.isPrefixOf (Text.concat [prefix, "!"]) title | |
]) | |
["fix", "feat", "build", "chore", "ci", "docs", "style", | |
"refactor", "perf", "test", "BREAKING CHANGE", "revert"] | |
then Text.putStrLn "Title is OK." | |
else Error.error "Title is not a conventional commit. See <https://www.conventionalcommits.org/en/v1.0.0/>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment