Skip to content

Improvement: Automate the creation of a version tag on a monthly basis #18

Improvement: Automate the creation of a version tag on a monthly basis

Improvement: Automate the creation of a version tag on a monthly basis #18

Workflow file for this run

name: Create a new version tag
on:
pull_request:
workflow_dispatch:
schedule:
# trigger at 0:00 on the first day of each month
- cron: '0 0 1 * *'
jobs:
monthly_release:
runs-on: ubuntu-latest
steps:
#checkout main branch
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
ref: main
persist-credentials: false
# Create version name accessible in the following steps
- name: Set version name
run: echo "VERSION_NAME=v4.0.0-$(date +'%Y.%m.%d')" >> $GITHUB_ENV
#create a new branch for the version tag
- name: Create version tag
run: |
git config user.email "t8ddy.bot@gmail.com"
git config user.name "t8ddy"
# configure remote to use the secret token for pushing
git remote set-url origin https://x-access-token:${{ secrets.T8DDY_TOKEN }}@github.com/${{ github.repository }}
git tag "${{ env.VERSION_NAME }}"
git push origin --tags