Simple shell script question. Setting up pipelines in BB and one of the jobs I am porting over is to increment a bower version via some grunt commands. I had this broken up into separate jobs so that it would not auto-run because it bumps the package, and commits back to the repo. So what I am trying to do is when the tasks start, run a git log command, check the last commit message and if it matches a pre-defined message then just exit. Otherwise continue on. How do I check the latest git commit message and run an if else check in bash?
#! /bin/bash
git log -1
if git log -1 === "pre-defined message";
then
echo "already pushed and bumped exiting"
exit 1
else
echo "not bumped -- continuing job"
./setup-git.sh
fi