on:
  pull_request:
    types: [ closed ]

name: "Cleanup automerge"

jobs:
  remove-label:
    name: "Remove automerge label"

    runs-on: "ubuntu-latest"

    steps:
      - name: "Remove label"
        uses: "actions/github-script@v3"
        with:
          github-token: ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
          script: |
            github.issues.removeLabel({
              issue_number: context.payload.pull_request.number,
              owner: context.repo.owner,
              repo: context.repo.repo,
              name: 'automerge'
            })

Remove automerge label after merging
Remove automerge label after merging
