name: Dependabot Automerge
permissions:
  contents: write
  pull-requests: write
on:
  workflow_run:
    workflows:
      - Node.js Package
    types:
      - completed

jobs:
  automerge:
    if: >
      github.event.workflow_run.conclusion == 'success' &&
      github.event.workflow_run.event == 'push' &&
      github.event.workflow_run.actor.login == 'dependabot[bot]'
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Automerge
        uses: "pascalgn/automerge-action@v0.16.4"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          MERGE_METHOD: squash
          MERGE_LABELS: ""
          MERGE_RETRY_SLEEP: "100000"

