From a0bad834d08b1747fe6f6e42fa5a675641369b03 Mon Sep 17 00:00:00 2001 From: Maxcastel Date: Wed, 15 Apr 2026 12:13:31 +0200 Subject: [PATCH] feat: add dependabot and add dependabot auto-merge --- .github/dependabot.yml | 41 +++++++++++++++++++++ .github/workflows/auto-merge-dependabot.yml | 31 ++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/auto-merge-dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..c9b6c5a4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,41 @@ +version: 2 + +updates: + - package-ecosystem: composer + directory: /api + schedule: + interval: weekly + commit-message: + prefix: "chore(deps)" + pull-request-branch-name: + separator: "/" + groups: + security-patches: + patterns: + - "*" + update-types: + - "patch" + + - package-ecosystem: npm + directory: /pwa + schedule: + interval: weekly + commit-message: + prefix: "chore(deps)" + pull-request-branch-name: + separator: "/" + groups: + security-patches: + patterns: + - "*" + update-types: + - "patch" + + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + commit-message: + prefix: "chore(deps)" + pull-request-branch-name: + separator: "/" diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml new file mode 100644 index 00000000..a99a0d26 --- /dev/null +++ b/.github/workflows/auto-merge-dependabot.yml @@ -0,0 +1,31 @@ +name: Auto-merge Dependabot PRs + +on: + pull_request_target: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: github.event.pull_request.user.login == 'dependabot[bot]' && github.actor == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Auto-merge patch security updates + if: | + steps.metadata.outputs.update-type == 'patch-update' && + (steps.metadata.outputs.dependency-type == 'direct:production' || + steps.metadata.outputs.dependency-type == 'direct:development') + run: gh pr merge --auto --rebase "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}