From 2b9aa8d70935105ce492bf027bac25d1300f4e45 Mon Sep 17 00:00:00 2001 From: Arthur Green Date: Sun, 19 Nov 2023 23:45:12 +0400 Subject: [PATCH] ci: enable dependabot auto merge --- .github/dependabot.yml | 3 --- .github/workflows/dependabot-auto-merge.yml | 23 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 839fe6b..3cc0fc5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,9 +5,6 @@ updates: directory: '/' schedule: interval: 'weekly' - ignore: - - dependency-name: '*' - update-types: ['version-update:semver-patch'] groups: react-dependencies: patterns: diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 0000000..ee2b34e --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -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 + with: + github-token: '${{ secrets.GITHUB_TOKEN }}' + - name: Enable auto-merge for Dependabot PRs + if: contains(steps.metadata.outputs.dependency-names, 'my-dependency') && steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}