From fd46d00fbf24a8539cc931d805be2c533f801807 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Wed, 24 Apr 2024 17:21:24 +0545 Subject: [PATCH] Make errors in finding current version visible Was silent in https://github.com/openfisca/country-template/actions/runs/8810580013, which led to failed merge in https://github.com/openfisca/country-template/pull/139 --- .github/is-version-number-acceptable.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/is-version-number-acceptable.sh b/.github/is-version-number-acceptable.sh index 3827db06..0c86be5b 100755 --- a/.github/is-version-number-acceptable.sh +++ b/.github/is-version-number-acceptable.sh @@ -14,6 +14,12 @@ fi current_version=$(grep '^version =' pyproject.toml | cut -d '"' -f 2) # parsing with tomllib is complicated, see https://github.com/python-poetry/poetry/issues/273 +if [[ ! $current_version ]] +then + echo "Error getting current version" + exit 1 +fi + if git rev-parse --verify --quiet $current_version then echo "Version $current_version already exists in commit:" @@ -21,7 +27,7 @@ then echo echo "Update the version number in pyproject.toml before merging this branch into main." echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated." - exit 1 + exit 2 fi if ! $(dirname "$BASH_SOURCE")/has-functional-changes.sh | grep --quiet CHANGELOG.md