Skip to content

v1.0.1

v1.0.1 #8

name: Update major version tag
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g. v1.0.0)'
required: true
type: string
permissions:
contents: write
jobs:
update-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
token: ${{ secrets.GH_PAT_FOR_UPDATE_TAG }}
- name: Extract major version
id: version
run: |
TAG="${{ inputs.tag || github.ref_name }}" # e.g. v1.0.0
MAJOR="${TAG%%.*}" # e.g. v1
echo "major=$MAJOR" >> "$GITHUB_OUTPUT"
- name: Update major version tag
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -fa "${{ steps.version.outputs.major }}" -m "Update ${{ steps.version.outputs.major }} to ${{ inputs.tag || github.ref_name }}"
git push origin "${{ steps.version.outputs.major }}" --force