devmasx / merge-branch

A GitHub Action that merge PR branch to other branchs
161 stars 58 forks source link

delete merged branch? #27

Closed utkarshsethi closed 2 years ago

utkarshsethi commented 2 years ago

Is there a way to also delete the merged branch?

I've tried looking at the API, but can't seem to find a way to do it. [might also be simply in-experienced]

This will allow total automation of some tasks instead of having to delete merged branches later.

utkarshsethi commented 2 years ago

Found the solution. For anyone's future reference:

For a specific repo can be enabled in settings. as follows: image

Or I created a simple workflow using gh cli:

      - uses: actions/checkout@master

        #merge and delete
      - name: Auto Merge [branch] -> master
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
        run: |
          gh pr checkout [branch]
          gh pr merge -d -m