From dab5a4c8f38c62d359e3b831451b5595230e3752 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:15:15 +0200 Subject: [PATCH] fix(auto-merge): exclude pre-1.0.0 major changes (#536) "(...) Cargo uses the convention that only changes in the left-most non-zero component are considered incompatible." See: https://doc.rust-lang.org/cargo/reference/semver.html --- .github/workflows/auto-merge.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 61b127b9..608680a0 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -9,10 +9,17 @@ jobs: auto-merge: runs-on: ubuntu-latest if: github.actor == 'dependabot[bot]' + steps: - - uses: ahmadnassri/action-dependabot-auto-merge@v2.6 + - name: Dependabot metadata + id: dependabot-metadata + uses: dependabot/fetch-metadata@v2 with: github-token: ${{ secrets.AUTOMERGE_TOKEN }} - command: "squash and merge" - approve: true - target: minor + + - name: Squash and merge + + if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' && !startsWith(steps.dependabot-metadata.outputs.previous-version, '0.') || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' && !startsWith(steps.dependabot-metadata.outputs.previous-version, '0.0.') }} + env: + GITHUB_TOKEN: ${{ secrets.AUTOMERGE_TOKEN }} + run: gh pr comment ${{ github.event.pull_request.html_url }} --body "@dependabot squash and merge"