name: 'Push Github Tag'
description: 'Pushes a new github tag from Master'

inputs:
  tag-name:    
    description: 'name of the tag'
    required: true
    default: 'tag'
  message:    
    description: 'message'
    required: false
    default: 'message'      

runs:
  using: 'composite'  

  steps:    

  # - name: Checkout
  #   uses: actions/checkout@v4

  # https://github.com/orgs/community/discussions/40405
  - run: |
      git config --global user.name "${{ github.actor }}"
      git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
      git tag -a "${{inputs.tag-name}}" -m "${{inputs.message}}"
      git push origin "${{inputs.tag-name}}"
    shell: bash

  # # alternative solution:
  # # https://github.com/rickstaa/action-create-tag
  # - name: create tag
  #   uses: rickstaa/action-create-tag@v1
  #   id: "tag_create"
  #   with:
  #     tag: "${{inputs.tag-name}}"
  #     tag_exists_error: true
  #     message: "${{inputs.message}}"