name: Release - Tag

on:
  # enable running the workflow manually
  workflow_dispatch:
    inputs:
      revision:
        type: string
        description: 'Release version'
        default: '0-SNAPSHOT'
      override_tag:
        type: boolean
        description: 'If to move the tag if already exists'
        default: false

permissions:
  contents: write

jobs:
  tag:
    # only on original eclipse-hawkbit/hawkbit repo and when release fixed version
    if: github.repository == 'eclipse-hawkbit/hawkbit' && inputs.revision != '0-SNAPSHOT'
    uses: ./.github/workflows/reusable_workflow_tag.yaml
    permissions:
      contents: write
    with:
      tag_name: ${{ inputs.revision }}
      tag_message: "Release version ${{ inputs.revision }}"
      override_tag: ${{ inputs.override_tag }}