watchexec/bin/pre-release-pull

17 lines
410 B
Bash
Executable File

#!/usr/bin/env bash
[[ ! -z "$WORKSPACE_ROOT" ]] && cd "$WORKSPACE_ROOT"
set -euo pipefail
mainbranch="main"
upstream_rx="watchexec/"
upstream=$(git remote -v | grep -i "$upstream_rx" -m1 | awk '{print $1}')
echo "Upstream remote discovered as: $upstream"
echo "Pulling from upstream"
git pull --rebase --autostash "$upstream" "$mainbranch"
echo "Fetching tags from upstream"
git fetch --tags "$upstream"