File tree Expand file tree Collapse file tree 1 file changed +0
-34
lines changed
Expand file tree Collapse file tree 1 file changed +0
-34
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ actions:
5656 - trunk-upgrade-available
5757 - trunk-check-pre-commit
5858 - ensure-tag-matches-version
59- - update-version-from-tag
6059 definitions :
6160 - id : ensure-tag-matches-version
6261 description : Hooks to ensure git tag matches version in pyproject.toml
@@ -91,39 +90,6 @@ actions:
9190 echo "Not on main/master branch - skipping tag validation."
9291 fi
9392 exit 0
94- - id : update-version-from-tag
95- description : Update version in pyproject.toml from git tag
96- triggers :
97- - git_hooks :
98- - pre-push
99- run : |
100- #!/usr/bin/env bash
101- set -e
102-
103- # Check if we're on main or master branch
104- if git rev-parse --abbrev-ref HEAD | grep -q 'main\|master'; then
105- # Try to get the tag for the current commit, ignore errors
106- TAG=$(git describe --tags --exact-match "$(git log -n1 --pretty='%h')" 2>/dev/null || true)
107-
108- # If no tag found, skip updating version entirely
109- if [ -z "$TAG" ]; then
110- echo "No tag found for the current commit - skipping version update."
111- exit 0
112- fi
113-
114- # Update pyproject.toml version if it differs from the tag
115- VERSION=$(grep '^version =' pyproject.toml | sed -E 's/version = "(.*)"/\1/' 2>/dev/null || echo "")
116-
117- if [ "$TAG" != "$VERSION" ]; then
118- echo "Updating version in pyproject.toml from '$VERSION' to '$TAG'."
119- uv version "$TAG"
120- else
121- echo "Version in pyproject.toml already matches tag '$TAG'."
122- fi
123- else
124- echo "Not on main/master branch - skipping version update."
125- fi
126- exit 0
12793tools :
12894 enabled :
12995
You can’t perform that action at this time.
0 commit comments