watchexec/bin/pre-release-pull

17 lines
410 B
Text
Raw Normal View History

2022-02-09 12:28:53 +01:00
#!/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"