Created
February 26, 2015 15:08
-
-
Save loa/c2fe15baaed7f4ddccf6 to your computer and use it in GitHub Desktop.
Python verify Git Head is not tagged release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import re | |
import subprocess | |
# Make sure HEAD is not a release | |
gitdescribe = subprocess.check_output('git describe', shell=True) | |
release_pattern = re.compile(r"^(v|)\d+\.\d+\.\d+$") | |
if release_pattern.match(gitdescribe): | |
sys.stderr.write("ERROR: HEAD is a release, will not release\n") | |
sys.exit(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment