From 6293397104b2870c7446f0b1b30f9b8daa0905b8 Mon Sep 17 00:00:00 2001 From: Thang Bui Quang <89576896+thangbuiq@users.noreply.github.com> Date: Fri, 9 Feb 2024 07:49:14 +0000 Subject: [PATCH] feat: add dependabot with auto merge workflow --- .github/dependabot.yml | 13 +++++++++++++ .github/workflows/dependabot.auto.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dependabot.auto.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2522b98 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' + + # Maintain dependencies for npm + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'weekly' diff --git a/.github/workflows/dependabot.auto.yml b/.github/workflows/dependabot.auto.yml new file mode 100644 index 0000000..4df91b9 --- /dev/null +++ b/.github/workflows/dependabot.auto.yml @@ -0,0 +1,27 @@ +name: 'Dependabot Automerge - Action' + +on: + pull_request: + +jobs: + worker: + runs-on: ubuntu-latest + + if: github.actor == 'dependabot[bot]' + steps: + - name: automerge + uses: actions/github-script@0.2.0 + with: + script: | + github.pullRequests.createReview({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, + pull_number: context.payload.pull_request.number, + event: 'APPROVE' + }) + github.pullRequests.merge({ + owner: context.payload.repository.owner.login, + repo: context.payload.repository.name, + pull_number: context.payload.pull_request.number + }) + github-token: ${{github.token}}