name: "Infra: Release Drafter run"

on:
  push:
    branches:
      - master
  workflow_dispatch:
    inputs:
      version:
        description: 'Release version'
        required: false
      branch:
        description: 'Target branch'
        required: false
        default: 'master'

permissions:
  contents: read

jobs:
  update_release_draft:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: release-drafter/release-drafter@v5
        with:
          config-name: release_drafter.yaml
          disable-autolabeler: true
          version: ${{ github.event.inputs.version }}
          commitish: ${{ github.event.inputs.branch }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
