Last active
February 25, 2020 09:48
-
-
Save cezarypiatekGC/0a6b7ab3fd8a81471fc292de95e3bae4 to your computer and use it in GitHub Desktop.
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
$parents = $(git log --pretty=%P -n 1) -split '\s' | |
$messages = git log --pretty=%s "$($parents[0])...$($parents[1])" | |
foreach($message in $messages) | |
{ | |
if($message -NotMatch "^[a-z]+-[0-9]+:") | |
{ | |
Write-Error "Commit message missing JIRA prefix: $message" | |
}else | |
{ | |
Write-Host "Message ok: $message" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment