mirror of
https://github.com/crazy-max/ghaction-import-gpg.git
synced 2024-11-25 14:31:03 -05:00
Add automerge workflow
This commit is contained in:
parent
14b3dfee6d
commit
2624ea18fb
1 changed files with 46 additions and 0 deletions
46
.github/workflows/automerge.yml
vendored
Normal file
46
.github/workflows/automerge.yml
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
name: automerge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
- synchronize
|
||||||
|
- unlocked
|
||||||
|
check_suite:
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
status: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dependabot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Approve
|
||||||
|
uses: actions/github-script@0.9.0
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
await github.pulls.createReview({
|
||||||
|
owner: context.payload.repository.owner.login,
|
||||||
|
repo: context.payload.repository.name,
|
||||||
|
pull_number: context.payload.pull_request.number,
|
||||||
|
event: 'APPROVE'
|
||||||
|
})
|
||||||
|
-
|
||||||
|
name: Wait
|
||||||
|
run: sleep 3
|
||||||
|
-
|
||||||
|
name: Merge
|
||||||
|
uses: actions/github-script@0.9.0
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
await github.pulls.merge({
|
||||||
|
owner: context.payload.repository.owner.login,
|
||||||
|
repo: context.payload.repository.name,
|
||||||
|
pull_number: context.payload.pull_request.number,
|
||||||
|
merge_method: 'squash'
|
||||||
|
})
|
Loading…
Reference in a new issue