Skip to content

more debug

more debug #12

Workflow file for this run

name: Add Tags
on:
push:
branches:
- main
- dev/amcneill_tags
jobs:
auto-tag:
runs-on:
labels: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Git Tag
id: generate_id
run: |
VERSION_PREFIX="v"
VERSION_MAJOR_MINOR="1.0"
echo $VERSION_PREFIX
echo $VERSION_MAJOR_MINOR
git tag
git tag -l
git tag -l --sort=-version:refname
git tag --list --sort=-version:refname "${VERSION_PREFIX}${VERSION_MAJOR_MINOR}.*"
git tag --list "${VERSION_PREFIX}${VERSION_MAJOR_MINOR}.*" --sort=-version:refname | head -n 1
git tag --list "${VERSION_PREFIX}${VERSION_MAJOR_MINOR}.*" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$'
VERSION_PATCH=$(git tag --list "${VERSION_PREFIX}${VERSION_MAJOR_MINOR}.*" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$')
echo $VERSION_PATCH
if [ -z "$VERSION_PATCH" ]; then
VERSION_PATCH=0
else
VERSION_PATCH=$((VERSION_PATCH + 1))
fi
NEW_TAG="${VERSION_PREFIX}${VERSION_MAJOR_MINOR}.${VERSION_PATCH}"
echo "Generated new tag: $NEW_TAG"
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV
- name: Push Git Tag
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions@users.noreply.github.com"
git tag $NEW_TAG
git push origin $NEW_TAG