Skip to content

Git tag

Git tag #72

Workflow file for this run

name: Git tag
on:
workflow_dispatch:
schedule:
- cron: "0 11 * * 2"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
set_tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "main"
fetch-depth: 0
token: ${{secrets.PAT}}
- name: Create and push new tag
run: |
tag=$(date +'%Y%m%d')
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
if [ git tag -l $tag ]; then
echo "Tag $tag already exists."
exit 1
else
git tag $tag
git push origin $tag
fi