Skip to content

πŸ“Š Add metric endpoint #22

πŸ“Š Add metric endpoint

πŸ“Š Add metric endpoint #22

Workflow file for this run

---
name: πŸ”– Publish New Tag
on:
push:
branches:
- main
paths:
- cmd/info/version.go
permissions:
contents: write
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v6
- name: πŸ”’ Extract version from version.go
id: extract_version
run: |
VERSION=$(grep -oP 'Version = "\K[^"]+' cmd/info/version.go)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
- name: πŸ§ͺ Check if tag exists
id: check_tag
run: |
if git ls-remote --exit-code --tags origin "refs/tags/v$VERSION"; then
echo "Tag v$VERSION already exists on origin. Skipping."
exit 0
fi
- name: πŸ”– Create and push tag
run: |
git tag "v$VERSION"
git push origin "v$VERSION"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REF: refs/tags/v$VERSION
GITHUB_REPOSITORY: ${{ github.repository }}