Git tag #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 'github-actions@users.noreply.github.com' | |
if [ git tag -l $tag ]; then | |
echo "Tag $tag already exists." | |
exit 1 | |
else | |
git tag $tag | |
git push origin $tag | |
fi |