File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,14 @@ git pull
10
10
VERSION_TAG=$( git describe --tags --abbrev=0 | cut -b 2-)
11
11
VERSION_PYPROJECT=$( poetry version --short)
12
12
13
+ IS_COMMIT_TAGGED=$( git tag --points-at HEAD | grep -q " ^v[0-9]\+\.[0-9]\+\.[0-9]\+$" && echo " true" || echo " false" )
14
+
15
+ # if we're already on a tagged commit, and the versions match, exit with 0
16
+ if [ " ${VERSION_TAG} " == " ${VERSION_PYPROJECT} " ] && [ " ${IS_COMMIT_TAGGED} " == " true" ]; then
17
+ echo " Version ${VERSION_TAG} is already tagged, assuming up-to-date"
18
+ exit 0
13
19
# if the version in pyproject.toml is not the same as the latest tag, we need to bump the version
14
- if [ " ${VERSION_TAG} " != " ${VERSION_PYPROJECT} " ]; then
20
+ elif [ " ${VERSION_TAG} " != " ${VERSION_PYPROJECT} " ]; then
15
21
echo " The latest tag is ${VERSION_TAG} but the version in pyproject.toml is ${VERSION_PYPROJECT} "
16
22
echo " Updating the version in pyproject.toml to match the latest tag"
17
23
poetry version ${VERSION}
You can’t perform that action at this time.
0 commit comments