name: 🚀 Release new action version

on:
  release:
    types: [released]

  workflow_dispatch:
    inputs:
      TAG_NAME:
        description: Tag name that the major tag will point to
        required: true

permissions:
  contents: write

jobs:
  update_tag:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

      - uses: actions/publish-action@f784495ce78a41bac4ed7e34a73f0034015764bb # v0.3.0
        env:
          TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
        with:
          source-tag: ${{ env.TAG_NAME }}
