pico-post-receive.sh

· erock's pastes · raw

expires: 2026-03-18

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