diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml new file mode 100644 index 00000000..dc18661b --- /dev/null +++ b/.github/workflows/auto-merge-dependabot.yml @@ -0,0 +1,36 @@ +name: Auto-merge Dependabot PRs + +on: + pull_request_target: + branches: + - main + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + permissions: + pull-requests: write + contents: write + steps: + - name: Auto-approve Dependabot PRs + uses: hmarr/auto-approve-action@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Wait for tests to succeed + uses: lewagon/wait-on-check-action@v1.3.1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + check-name: 'test' # Имя джоба из вашего test.yml + wait-interval: 20 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Auto-merge Dependabot PRs + if: success() + uses: pascalgn/automerge-action@v0.15.6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MERGE_METHOD: "squash" + MERGE_LABELS: "dependencies" + MERGE_COMMIT_MESSAGE: "pull-request-title"