From 1b2daab6354531299ce5c540ec049a7dd64ff425 Mon Sep 17 00:00:00 2001 From: Nemo Date: Wed, 27 Dec 2023 10:13:56 +0530 Subject: [PATCH] setup auto-updates --- .github/dependabot.yml | 24 ++++++++++++++++++++ .github/workflows/auto-merge-dependabot.yml | 25 +++++++++++++++++++++ 2 files changed, 49 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 0000000..706c100 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,24 @@ +# 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/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "bundler" + vendor: true + directory: "/" + schedule: + interval: "daily" + + # This updates the _data/emoji_every_day submodule once a day + # which itself is updated twice a day. + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/auto-merge-dependabot.yml b/.github/workflows/auto-merge-dependabot.yml new file mode 100644 index 0000000..774a4cb --- /dev/null +++ b/.github/workflows/auto-merge-dependabot.yml @@ -0,0 +1,25 @@ +name: Dependabot auto-merge release-updates +on: pull_request + +# Based on https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - id: metadata + name: Dependabot metadata + uses: dependabot/fetch-metadata@v1.6.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Enable auto-merge for Dependabot PRs for release data + if: ${{contains(steps.metadata.outputs.dependency-names, '_data/emoji_every_day')}} + run: gh pr merge --auto --rebase "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file