Merge pull request #189 from nanos/fix-tagging

only update version tag if not already up to date
This commit is contained in:
Michael 2024-12-05 08:18:42 +00:00 committed by GitHub
commit c5eb941eb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,12 +18,14 @@ jobs:
git config user.email bot@thms.uk
VERSION=${{ github.ref_name }}
VERSION="${VERSION:1}"
if ! grep "VERSION = \"$VERSION\"" "find_posts.py"; then
sed -i -E 's/VERSION = "[0-9]+.[0-9]+.[0-9]+"/VERSION = "'$VERSION'"/' find_posts.py
git add find_posts.py
git commit -m "[bot] Bump version to $VERSION"
git push origin HEAD:main > /dev/null 2>&1
git tag -f "v$VERSION"
git push -f origin "v$VERSION" > /dev/null 2>&1
fi
docker:
runs-on: ubuntu-latest