Skip to content

Instantly share code, notes, and snippets.

@gusfune
Last active December 20, 2021 12:19
Show Gist options
  • Save gusfune/19ba6e9da4d5b39a95fc246e38777598 to your computer and use it in GitHub Desktop.
Save gusfune/19ba6e9da4d5b39a95fc246e38777598 to your computer and use it in GitHub Desktop.
DangerJS check for gitmoji usage
// 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