diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 83f95c9..21778b0 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -15,8 +15,14 @@ jobs: uses: dependabot/fetch-metadata@v1 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Enable auto-merge for Dependabot PRs - if: contains(steps.metadata.outputs.dependency-names, '@commitlint/cli') || contains(steps.metadata.outputs.dependency-names, '@commitlint/travis-cli') + - name: Auto merge major versions + if: (contains(steps.metadata.outputs.dependency-names, '@commitlint/cli') || contains(steps.metadata.outputs.dependency-names, '@commitlint/travis-cli')) && step.metadata.outputs.update-type != 'version-update:semver-major' + run: gh pr merge --body "BREAKING CHANGE" --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Auto-merge non major versions + if: (contains(steps.metadata.outputs.dependency-names, '@commitlint/cli') || contains(steps.metadata.outputs.dependency-names, '@commitlint/travis-cli')) && step.metadata.outputs.update-type != 'version-update:semver-major' run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}}