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"