From f03b8ef890537815479872f03c7191d026096cf0 Mon Sep 17 00:00:00 2001 From: Michael Wuergler Date: Sun, 20 Oct 2024 17:21:00 +0200 Subject: [PATCH] ci: bring back auto-merge --- .github/workflows/release.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93d56cf..e02a121 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,9 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Show diff for debugging + run: git diff + # Create a Pull Request with the version bump if the release is not a pre-release - name: Create Pull Request for Version Bump if: success() && env.IS_PRE_RELEASE == 'false' @@ -56,3 +59,20 @@ jobs: labels: version-bump token: ${{ secrets.GITHUB_TOKEN }} base: main + + # Auto-merge the Pull Request with the version bump if the release is not a pre-release + - name: Enable Auto-Merge + if: success() && env.IS_PRE_RELEASE == 'false' + uses: peter-evans/enable-pull-request-automerge@v3 + with: + pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }} + token: ${{ secrets.GITHUB_TOKEN }} + merge-method: squash + + # Clean up the version bump branch after merge + - name: Delete Version Bump Branch + if: success() && env.IS_PRE_RELEASE == 'false' + run: | + git push origin --delete version-bump/${{ env.RELEASE_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}