Skip to content

Merge pull request #108 from TheWorldAvatar:dependabot-26-02-25 #17

Merge pull request #108 from TheWorldAvatar:dependabot-26-02-25

Merge pull request #108 from TheWorldAvatar:dependabot-26-02-25 #17

Workflow file for this run

name: Tag Version
on:
push:
branches:
- main
workflow_dispatch:
jobs:
tag-version:
runs-on: ubuntu-latest
permissions:
contents: write
env:
VERSION:
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.email "viz-bot@noreply.theworldavatar.io"
git config --global user.name "twa-viz-bot"
- name: Save version to environment
run: |
if [ -f VERSION ]; then
echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
else
echo "VERSION file not found" && exit 1
fi
- name: Check if tag exists
id: check_tag
run: |
if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then
echo "TAG_EXISTS=true" >> $GITHUB_ENV
else
echo "TAG_EXISTS=false" >> $GITHUB_ENV
fi
- name: Create tag
if: env.TAG_EXISTS == 'false'
run: |
git tag -a "v${{ env.VERSION }}" -m "Version ${{ env.VERSION }}"
git push origin "v${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}