From bbfa8b3c216117ce5c29cb2edca651b5857d435c Mon Sep 17 00:00:00 2001 From: Julien Goux Date: Fri, 10 Apr 2026 08:53:09 +0200 Subject: [PATCH] fix: fix auto-approval and refine dependabot policy --- .github/dependabot.yml | 30 ++++++++++++++++++++---------- .github/workflows/dependabot.yml | 14 +++++++++++--- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 36f736b..1f28642 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,9 +4,17 @@ updates: directory: / schedule: interval: weekly - open-pull-requests-limit: 2 + day: tuesday + time: "09:00" + timezone: Europe/Paris + open-pull-requests-limit: 1 + cooldown: + semver-minor-days: 7 + semver-patch-days: 2 groups: - actions-minor: + actions-minor-patch: + patterns: + - "*" update-types: - minor - patch @@ -15,15 +23,17 @@ updates: directory: / schedule: interval: weekly - open-pull-requests-limit: 2 + day: tuesday + time: "09:00" + timezone: Europe/Paris + open-pull-requests-limit: 1 + cooldown: + semver-minor-days: 7 + semver-patch-days: 2 groups: - bun-development: - dependency-type: development - update-types: - - minor - - patch - bun-production: - dependency-type: production + bun-minor-patch: + patterns: + - "*" update-types: - minor - patch diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 0b80910..a092ccb 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -24,15 +24,23 @@ jobs: with: github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Generate token + id: app-token + if: ${{ steps.meta.outputs.update-type == null || steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor' }} + uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} + - name: Approve a PR - if: ${{ steps.meta.outputs.update-type != 'version-update:semver-major' }} + if: ${{ steps.meta.outputs.update-type == null || steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor' }} run: gh pr review --approve "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - name: Enable auto-merge for Dependabot PRs - if: ${{ steps.meta.outputs.update-type != 'version-update:semver-major' }} + if: ${{ steps.meta.outputs.update-type == null || steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor' }} run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }}