#!/usr/bin/env bash BRANCH="main" while read oldrev newrev ref do # only checking out the master (or whatever branch you would like to deploy) if [ "$ref" = "refs/heads/$BRANCH" ]; then echo "Ref $ref received. Sending event for ${BRANCH}" echo "pico" | ssh pipe.pico.sh pub git-drain else echo "Ref $ref received. Doing nothing: only the ${BRANCH} branch will trigger." fi done