name: PRMerged
run-name: "PR ${{github.event.number || inputs.pr_number}} ${{github.event.action || 'MANUAL POST MERGE'}} by ${{ github.actor }}"
on:
  pull_request_target:
    types: [closed]
  workflow_dispatch:
    inputs:
      pr_number:
        description: 'PR number'
        required: true
        type: number

concurrency:
  group: ${{github.workflow}}-${{github.event.number || inputs.pr_number}}
  cancel-in-progress: true

env:
  REPO:              ${{github.repository}}
  PR_NUMBER:         ${{github.event.number || inputs.pr_number}}
  GITHUB_TOKEN:      ${{secrets.GITHUB_TOKEN}}

jobs:
  CloseIssues:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/auto-close-fixed-issues@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

