diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e5066ea --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,31 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directories: + - "/" + schedule: + interval: "daily" + time: "09:00" + timezone: "Europe/Berlin" + versioning-strategy: increase + commit-message: + prefix: "deps" + prefix-development: "deps(dev)" + reviewers: + - "bajtos" + - "juliangruber" + - "pyropy" + - "NikolasHaimerl" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + time: "09:00" + timezone: "Europe/Berlin" + commit-message: + prefix: "ci" + reviewers: + - "bajtos" + - "juliangruber" + - "pyropy" + - "NikolasHaimerl" diff --git a/.github/workflows/dependabot-auto-approve-minor.yml b/.github/workflows/dependabot-auto-approve-minor.yml new file mode 100644 index 0000000..7ca90e5 --- /dev/null +++ b/.github/workflows/dependabot-auto-approve-minor.yml @@ -0,0 +1,28 @@ +name: Dependabot auto-approve minor updates +on: pull_request + +permissions: + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + strategy: + matrix: + dependencyStartsWith: + - '@cloudflare/' + - 'wrangler' + - 'vitest' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + if: ${{startsWith(steps.metadata.outputs.dependency-names, matrix.dependencyStartsWith) && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.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}} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..5c3692a --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,18 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Authenticate cli with a PAT + run: echo "${{ secrets.DEPENDABOT_TOKEN }}" | gh auth login --with-token + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}}