I set up Git's post-receive
hook. I would like to run a specific program (for deployment) if the commit message contains a specific word. For an example let's say [publish].
I'm having difficulties finding out how can I capture the commit message in bash and I'm bad with bash.
Pseudocode for post-receive
:
#!/bin/bash
if [[ "$commit_message" == *"[publish]"* ]]
then
echo "Publishing.."
fi