diff --git a/.github/workflows/auto-merge-bots.yml b/.github/workflows/auto-merge-bots.yml index c404ed5..6426435 100644 --- a/.github/workflows/auto-merge-bots.yml +++ b/.github/workflows/auto-merge-bots.yml @@ -19,7 +19,7 @@ jobs: - name: Auto-merge minor and patch updates if: steps.meta.outputs.update-type != 'version-update:semver-major' - run: gh pr merge --auto --squash "$PR_URL" + run: gh pr merge --auto --squash --delete-branch "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Auto-merge pre-commit.ci updates - run: gh pr merge --auto --squash "$PR_URL" + run: gh pr merge --auto --squash --delete-branch "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/delete-merged-bot-branches.yml b/.github/workflows/delete-merged-bot-branches.yml deleted file mode 100644 index 18fc4d2..0000000 --- a/.github/workflows/delete-merged-bot-branches.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Delete merged bot branches - -on: - pull_request: - types: [closed] - -permissions: - contents: write - -jobs: - delete-branch: - if: > - github.event.pull_request.merged == true && - (github.event.pull_request.user.login == 'pre-commit-ci[bot]' || - github.event.pull_request.user.login == 'dependabot[bot]') - runs-on: ubuntu-latest - steps: - - name: Delete head branch - run: gh api -X DELETE "repos/${GITHUB_REPOSITORY}/git/refs/heads/${HEAD_REF}" - env: - HEAD_REF: ${{ github.event.pull_request.head.ref }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}