Created
March 12, 2023 17:02
-
-
Save Grynn/262c8319f5b8e5fdc67e310dbb6b4a3f to your computer and use it in GitHub Desktop.
post_receive_hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Post recv. hook to run deploy.sh from within repo in checkout dir | |
set -e -u -o nounset | |
echo "ARGS****************" | |
read oldrev newrev ref | |
echo "OLD=$oldrev" "NEW=$newrev" "REF=$ref" | |
echo "********************" | |
if [ $ref == "refs/heads/master" ] || [[ $ref == refs/heads/main ]] ; then | |
eval "$(git show master:deploy.sh)" | |
else | |
echo "Ignoring push to $ref" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment