From 9b74c4fe4d7355de7d5c5635297d706268b710e7 Mon Sep 17 00:00:00 2001 From: Andrew-Chen-Wang Date: Thu, 1 Oct 2020 00:11:06 -0400 Subject: [PATCH] Add auto-merge dependabot --- .github/dependabot.yml | 8 ++++++++ .github/workflows/dependabot-merge.yml | 27 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/dependabot-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5ee5d0a04f..b60d4a618c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,3 +8,11 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + - package-ecosystem: pip + directory: "/{{ cookiecutter.project_slug }}/requirements" + schedule: + interval: daily diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml new file mode 100644 index 0000000000..3edeaa4997 --- /dev/null +++ b/.github/workflows/dependabot-merge.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}}