You can simply simply squash-and-merge instead.
- name: Enable auto-merge for Dependabot PRs
if: contains(github.event.pull_request.labels.*.name, 'automerge')
run: gh pr merge --squash --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}