Skip to content

Commit

Permalink
chore: automatically merge Dependabot PR if tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
blgm committed Oct 27, 2021
1 parent 1a7c021 commit 0c3290c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/test-and-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14', '16' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
automerge:
needs: test
name: Merge Dependabot Pull Pequest
runs-on: ubuntu-latest
if: ${{ success() && github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]' }}
steps:
- name: Merge
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.pulls.merge({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
merge_method: 'squash'
})
19 changes: 0 additions & 19 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit 0c3290c

Please sign in to comment.