From 4af33a09cbd6d5ee920820729985997738c8e0c4 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Fri, 19 Sep 2025 17:38:05 +0100 Subject: [PATCH 1/2] Add auto-tag workflow Runs when the version is bumped, creates and pushes a tag. --- .github/workflows/auto-tag.yml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/auto-tag.yml diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml new file mode 100644 index 0000000..3c27da3 --- /dev/null +++ b/.github/workflows/auto-tag.yml @@ -0,0 +1,39 @@ +name: Auto Tag on Version Bump + +on: + push: + branches: + - master + paths: + - VERSION + +jobs: + tag-repo: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Check out repository + uses: actions/checkout@v5 + + - name: Get current version + id: version + run: | + VERSION=$(cat VERSION) + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Skip if tag already exists + run: | + if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "skip=false" >> $GITHUB_OUTPUT + fi + + - name: Push tag + if: steps.checktag.outputs.skip == 'false' + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git tag "v${{ steps.version.outputs.version }}" + git push origin "v${{ steps.version.outputs.version }}" From 6e97105e18da477c1c781e26e69a0ae99ad7f8b5 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Fri, 19 Sep 2025 17:39:19 +0100 Subject: [PATCH 2/2] !fixup --- .github/workflows/auto-tag.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 3c27da3..f61b45c 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -22,7 +22,8 @@ jobs: VERSION=$(cat VERSION) echo "version=$VERSION" >> $GITHUB_OUTPUT - - name: Skip if tag already exists + - name: Check if tag already exists + id: checktag run: | if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then echo "skip=true" >> $GITHUB_OUTPUT