name: automerge
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: "20.x"
      - name: Install dependencies
        run: npm install
      - name: Build
        run: npm run build
  automerge:
    needs: build
    runs-on: ubuntu-latest

    permissions:
      pull-requests: write
      contents: write

    steps:
      - uses: fastify/github-action-merge-dependabot@v3.0.0
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
