watchexec/bin/pre-release-pull
2022-02-10 01:40:32 +13:00

16 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"