Skip to content

Update tag.yml

Update tag.yml #3

Workflow file for this run

name: Add and Read Tag
on: [push]
jobs:
add-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Add tag to commit
run: |
TAG_NAME="v1.0.$(date +%Y%m%d%H%M%S)"
git tag $TAG_NAME
git push origin $TAG_NAME
read-tag:
runs-on: ubuntu-latest
needs: add-tag
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Get existing version tag
id: get-existing-tag
run: |
echo "EXISTING=$(git tag --points-at HEAD | head -1)" >> $GITHUB_OUTPUT
- name: Output tag
run: echo "Tag:${{ steps.get-existing-tag.outputs.EXISTING }}"