Last active
December 20, 2021 12:19
-
-
Save gusfune/19ba6e9da4d5b39a95fc246e38777598 to your computer and use it in GitHub Desktop.
DangerJS check for gitmoji usage
This file contains 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
// Check if Gitmoji is being used in Commits | |
const regex = | |
/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi | |
danger.git.commits.forEach((commit) => { | |
const hasGitmoji = regex.test(commit.message) | |
if (!hasGitmoji) { | |
warn(`Please use gitmojis in commits.`) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment