name: Auto-enable Auto-merge
on:
  pull_request_target:
    types: [opened, synchronize, reopened, ready_for_review]

permissions:
  pull-requests: write
  contents: write

jobs:
  enable-auto-merge:
    runs-on: ubuntu-latest
    steps:
      - name: Enable Auto-Merge
        env:
          GH_TOKEN: ${{ github.token }}

        run: gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
