At most CI/CD processes it is necessary to perform actions that depend on the message of the commit. Here you can find out an example of how you can check if the commit message matches a certain regular expression.

GIT_COMMIT_DESC=$(git log --format=%B -n 1)
RELEASE_REGEX="[0-9][0-9]?\.[0-99][0-9]?\.[0-99][0-9]?(-.*\.[0-99])?"

if [[ "$GIT_COMMIT_DESC" =~ $RELEASE_REGEX ]];
then
  echo "Release commit, skipping release command"
else
  <<do something>>
fi