add workflow to move tags #2
Workflow file for this run
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: Update Major & Minor Release Tag | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
movetag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get major version num and update tag | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
MAJOR=${VERSION%%.*} | |
MAJOR_MINOR=${VERSION%.*} | |
git config --global user.name 'appcd-bot' | |
git config --global user.email 'appcd-bot@users.noreply.github.com' | |
git tag -fa "${MAJOR}" -m 'Update major version tag' | |
git tag -fa "${MAJOR_MINOR}" -m 'Update minor version tag' | |
git push origin "${MAJOR}" --force | |
git push origin "${MAJOR_MINOR}" --force |