Skip to content

Refactor secrets, info, and logs commands for consistency and robustness #17

Refactor secrets, info, and logs commands for consistency and robustness

Refactor secrets, info, and logs commands for consistency and robustness #17

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 }}