Created
February 18, 2015 14:15
-
-
Save nicoverbruggen/24492629c27fa87c38df to your computer and use it in GitHub Desktop.
Git hook that checks if you reference an issue in your commit
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
#!/usr/bin/env ruby | |
message_file = ARGV[0] | |
message = File.read(message_file) | |
$regex = /#(\d+)/ | |
if !$regex.match(message) | |
puts "[POLICY] Please reference an issue in your commit." | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing!