Skip to content

Commit

Permalink
Add GitHub action to automerge minor and patch updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Apr 30, 2021
1 parent e2c0c77 commit 7b1e552
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Automerge dependency updates

on: [pull_request]
jobs:
auto_merge:
runs-on: ubuntu-latest
if: |
github.event_name == 'pull_request' &&
github.actor == 'dependabot[bot]'
steps:
- name: "@dependabot merge"
uses: actions/github-script@v3
with:
script: |
const title = context.payload.pull_request.title;
const update_regex = /Update [^ ]* requirement from ~> ([1-9][0-9]*)\.\d+\.\d+ to ~> \1\.\d+\.\d+/;
const update_match = title.match(update_regex);
if (update_match !== null) {
console.log(`Detected allowed update in '${title}'`);
} else {
return;
}
github.issues.createComment({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
issue_number: context.payload.pull_request.number,
body: '@dependabot merge'
})

0 comments on commit 7b1e552

Please sign in to comment.