Skip to content

Instantly share code, notes, and snippets.

@maximgatilin
Created December 12, 2017 04:58
Show Gist options
  • Save maximgatilin/0951d3355097166545757b9b16a5caf7 to your computer and use it in GitHub Desktop.
Save maximgatilin/0951d3355097166545757b9b16a5caf7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file)
second_file = ARGV[1]
branchname = `git branch --no-color 2> /dev/null`[/^\* (.+)/, 1].to_s.downcase
$regex = /#{branchname}/
if !$regex.match(message.downcase)
puts branchname
puts "[POLICY] Your message is not formatted correctly"
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment