Skip to content

fix: tag ci (#15)

fix: tag ci (#15) #2

Workflow file for this run

name: Tag on Version Change
on:
push:
branches:
- master
workflow_dispatch:
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-tags: true
- name: Check Version
id: check_version
run: |
if [[ -f VERSION ]]; then
version=$(cat VERSION)
tags=$(git tag --list)
if [[ ! "$tags" =~ (^|[[:space:]])"$version"($|[[:space:]]) ]]; then
echo "::set-output name=tag::$version"
fi
fi
- name: Create Tag
if: steps.check_version.outputs.tag
run: |
git tag ${{ steps.check_version.outputs.tag }}
git push origin ${{ steps.check_version.outputs.tag }}