Skip to content

Instantly share code, notes, and snippets.

@nicoverbruggen
Created February 18, 2015 14:15
Show Gist options
  • Save nicoverbruggen/24492629c27fa87c38df to your computer and use it in GitHub Desktop.
Save nicoverbruggen/24492629c27fa87c38df to your computer and use it in GitHub Desktop.
Git hook that checks if you reference an issue in your commit
#!/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
@pulkitsinghal
Copy link

Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment