From c5d58e5f727ff5b165470b41df6cceb76486d0ed Mon Sep 17 00:00:00 2001 From: James Cooke Date: Fri, 27 Apr 2018 16:58:55 +0100 Subject: [PATCH] Add on_master check to tagging recipe --- Makefile | 6 +++++- on_master.sh | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 on_master.sh diff --git a/Makefile b/Makefile index 61e980d..997f47e 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,10 @@ testpypi: clean sdist bdist_wheel pypi: clean sdist bdist_wheel twine upload dist/* +.PHONY: on_master +on_master: + ./on_master.sh + .PHONY: tag -tag: +tag: on_master git tag -a $$(python -c 'from flake8_aaa.__about__ import __version__; print("v{}".format(__version__))') diff --git a/on_master.sh b/on_master.sh new file mode 100755 index 0000000..855374c --- /dev/null +++ b/on_master.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -eo pipefail + +git fetch origin -v + +branch_info=$(git status --short -b | head -1) + +if [[ $branch_info != '## master...origin/master' ]]; then + echo "Not on master or master not up to date with origin, branch = $branch_info" + exit 1 +fi