Skip to content

Commit

Permalink
feat: add dependabot with auto merge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thangbuiq committed Feb 9, 2024
1 parent 7e17730 commit 6293397
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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'
27 changes: 27 additions & 0 deletions .github/workflows/dependabot.auto.yml
Original file line number Diff line number Diff line change
@@ -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}}

0 comments on commit 6293397

Please sign in to comment.