Skip to content

v1.1.3

v1.1.3 #18

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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.tag || github.ref }}
persist-credentials: false
- name: Extract major version
id: version
env:
TAG: ${{ inputs.tag || github.ref_name }}
run: |
MAJOR="${TAG%%.*}"
echo "major=$MAJOR" >> "$GITHUB_OUTPUT"
- name: Update major version tag
env:
MAJOR: ${{ steps.version.outputs.major }}
TAG: ${{ inputs.tag || github.ref_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}"
git tag -fa "$MAJOR" -m "Update $MAJOR to $TAG"
git push origin "$MAJOR" --force