Skip to content

Instantly share code, notes, and snippets.

@flomotlik
Created April 26, 2014 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flomotlik/11325585 to your computer and use it in GitHub Desktop.
Save flomotlik/11325585 to your computer and use it in GitHub Desktop.
Check for branch name with Regex
#!/bin/bash
echo $COMMIT_BRANCH | grep -E "^(\d\.?)+$" > /dev/null
match_result=$?
if [ "$match_result" -eq "0" ]
then
# Exit if any command fails only when the deployment runs
set -e
echo MATCH
# Run commands if match
else
echo No Match
# Add message that there was no match
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment