name: latest-changes

on:
  pull_request_target:
    branches:
      - master
    types:
      - closed
  workflow_dispatch:
    inputs:
      number:
        description: PR number
        required: true

jobs:
  latest-changes:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          token: ${{ secrets.GH_W_TOKEN }}
      - name: Disable LFS hooks
        run: rm .git/hooks/post-commit .git/hooks/pre-push
      - uses: tiangolo/latest-changes@0.4.1
        with:
          token: ${{ secrets.GH_W_TOKEN }}
          template_file: ./.github/latest-changes.jinja2
          latest_changes_file: ./CHANGELOG.md
          latest_changes_header: '## \[Unreleased\]\n\n'
