Auto merge Github scripts does not work when upgrading to the latest version

I have defined a task to merge the dependencies automatically in the Github actions workflow.

  automerge:
    name: Merge pull request
    runs-on: ubuntu-latest
    needs: [build]
    if: github.base_ref == 'master' && github.actor == 'dependabot[bot]'
    steps:
      - name: Merge
        uses: actions/github-script@v4.0.2
        with:
          script: |
            github.pulls.merge({
              owner: context.payload.repository.owner.login,
              repo: context.payload.repository.name,
              pull_number: context.payload.pull_request.number
            })
          github-token: ${{secrets.GITHUB_TOKEN}}

But the actions/github-script does not work since upgrading to v3.0, I am not sure where is wrong.