Skip to content

Commit

Permalink
Merge pull request #189 from nanos/fix-tagging
Browse files Browse the repository at this point in the history
only update version tag if not already up to date
  • Loading branch information
nanos authored Dec 5, 2024
2 parents a53b637 + 45ed33d commit c5eb941
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/update-version-number.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ jobs:
git config user.email bot@thms.uk
VERSION=${{ github.ref_name }}
VERSION="${VERSION:1}"
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
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
Expand Down

0 comments on commit c5eb941

Please sign in to comment.