Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Created January 9, 2014 17:25
Show Gist options
  • Save phcostabh/8338165 to your computer and use it in GitHub Desktop.
Save phcostabh/8338165 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "determining branch"
if ! [ -t 0 ]; then
read -a ref
fi
IFS='/' read -ra REF <<< "${ref[2]}"
branch="${REF[2]}"
if [ "master" == "$branch" ]; then
echo 'master was pushed'
fi
if [ "staging" == "$branch" ]; then
echo 'staging was pushed'
fi
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment