File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,21 @@ jobs:
2525
2626 - name : Verify tag matches package version
2727 run : |
28- TAG_VERSION="${GITHUB_REF_NAME#v}"
2928 PACKAGE_VERSION="$(python - <<'PY'
3029import tomllib
3130with open("pyproject.toml", "rb") as f :
3231 data = tomllib.load(f)
3332print(data["project"]["version"])
3433PY
3534)"
36- if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
37- echo "Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)."
38- exit 1
35+ if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
36+ TAG_VERSION="${GITHUB_REF_NAME#v}"
37+ if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
38+ echo "Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)."
39+ exit 1
40+ fi
41+ else
42+ echo "Non-tag ref '${GITHUB_REF_NAME}', publishing package version ${PACKAGE_VERSION}."
3943 fi
4044
4145 - name : Build distributions
You can’t perform that action at this time.
0 commit comments