Skip to content
45 changes: 45 additions & 0 deletions .github/workflows/update-major-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Update Major Version
run-name: Move ${{ github.event.inputs.major_version }} to ${{ github.event.inputs.target }}

on:
workflow_dispatch:
inputs:
target:
description: "Target release tag (example: v1.2.0)"
required: true
major_version:
description: "Major version to update"
required: true
type: choice
options:
- v1
- v2

permissions:
contents: write

jobs:
tag:
runs-on: ubuntu-latest

steps:
- name: 📦 Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Update major tag
run: |
git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }}

- name: Push updated tag
run: |
git push origin ${{ github.event.inputs.major_version }} --force
...

Loading