From eaeebd1a1bf7e6f17b3f8151de976ec168bf4443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=88=90=E9=94=B4?= Date: Fri, 1 Dec 2023 20:15:44 +0800 Subject: [PATCH] update: add dependabot config --- .github/dependentabot.yml | 13 +++++++++++++ .github/workflows/depbot-auto-merge.yaml | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/dependentabot.yml create mode 100644 .github/workflows/depbot-auto-merge.yaml diff --git a/.github/dependentabot.yml b/.github/dependentabot.yml new file mode 100644 index 0000000..f2cd3e6 --- /dev/null +++ b/.github/dependentabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + commit-message: + prefix: "chore" \ No newline at end of file diff --git a/.github/workflows/depbot-auto-merge.yaml b/.github/workflows/depbot-auto-merge.yaml new file mode 100644 index 0000000..9351bfa --- /dev/null +++ b/.github/workflows/depbot-auto-merge.yaml @@ -0,0 +1,23 @@ +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: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.1.1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file