chore: perform further sanity checks before release

This commit is contained in:
Gregor Kleen 2019-07-26 12:16:15 +02:00
parent e1b3c46356
commit 96a4e00c0e

View File

@ -1,6 +1,21 @@
#!/usr/bin/env bash
if ! ( output=$(git status --porcelain) && [ -z "$output" ] ); then
set -e
if [ -n "$(git status --porcelain)" ]; then
echo "Working directory isn't clean" >&2
exit 1
fi
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
echo "Not on master" >&2
exit 1
fi
ourHash=$(git rev-parse HEAD)
theirHash=$(git ls-remote origin -h refs/heads/master | awk '{ print $1; }')
if [ "$theirHash" != "$ourHash" ]; then
echo "Local HEAD is not up to date with remote master" >&2
exit 1
fi