Add auto-merge dependabot

This commit is contained in:
Andrew-Chen-Wang 2020-10-01 00:11:06 -04:00
parent 5c92c1d277
commit 9b74c4fe4d
2 changed files with 35 additions and 0 deletions

View File

@ -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

27
.github/workflows/dependabot-merge.yml vendored Normal file
View File

@ -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}}