Major Version Updater #1
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: Major Version Updater | |
# Whenever a new release is made, push a major version tag | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: read | |
jobs: | |
update-major-version-tag: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | |
- name: version | |
id: version | |
shell: bash | |
run: | | |
# shellcheck disable=all | |
tag=${GITHUB_REF/refs\/tags\//}; | |
version=${tag#v} ; | |
major=${version%%.*} ; | |
echo "tag=${tag}" >> "$GITHUB_OUTPUT" ; | |
echo "version=${version}" >> "$GITHUB_OUTPUT" ; | |
echo "major=${major}" >> "$GITHUB_OUTPUT" ; | |
- name: force update major tag | |
run: | | |
git tag v${{ steps.version.outputs.major }} | |
git push origin refs/tags/v${{ steps.version.outputs.major }} -f |