Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 798 Bytes

cl1gu8q3d00otjvnv8bec3nlj.md

File metadata and controls

19 lines (16 loc) · 798 Bytes

Github Action to Enable Auto Merge

Github recently added support for automatically merging PR on checks completions. We can write a GitHub action to automate this process.

Github Action Job

enable-automerge:
  runs-on: ubuntu-latest
  permissions: write-all
  steps:
    - name: automerge
      run: gh pr merge --auto --squash "$PR_URL" -t "$PR_TITLE" -b "$PR_BODY"
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        PR_URL: ${{ github.event.pull_request.html_url }}
        PR_TITLE: ${{ github.event.pull_request.title }}
        PR_BODY: ${{ github.event.pull_request.body }}