Skip to content

Merge pull request #156 from aryaveer0710/github_workflows #1

Merge pull request #156 from aryaveer0710/github_workflows

Merge pull request #156 from aryaveer0710/github_workflows #1

Workflow file for this run

name: Auto Tag on Version Change
on:
push:
branches:
- master
jobs:
tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Read version and create tag if new
run: |
VERSION=$(grep '^version:' pubspec.yaml | awk '{print $2}')
TAG="v$VERSION"
if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then
echo "Tag $TAG already exists — skipping."
else
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "$TAG"
git push origin "$TAG"
echo "Tagged and pushed $TAG"
fi