2020-07-21 10:53:31 -04:00
|
|
|
---
|
|
|
|
#######################################
|
|
|
|
#######################################
|
|
|
|
## Dependabot automerge dependencies ##
|
|
|
|
#######################################
|
|
|
|
#######################################
|
|
|
|
|
|
|
|
#
|
|
|
|
# Documentation:
|
|
|
|
# https://medium.com/@toufik.airane/automerge-github-dependabot-alerts-with-github-actions-7cd6f5763750
|
|
|
|
#
|
|
|
|
|
|
|
|
######################
|
|
|
|
# name of the action #
|
|
|
|
######################
|
|
|
|
name: automerge on pull request
|
|
|
|
|
|
|
|
###############
|
|
|
|
# When to run #
|
|
|
|
###############
|
|
|
|
on: [pull_request]
|
|
|
|
|
|
|
|
#################
|
|
|
|
# Start the job #
|
|
|
|
#################
|
|
|
|
jobs:
|
|
|
|
automerge:
|
|
|
|
name: automerge dependabot
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.actor == 'dependabot[bot]'
|
|
|
|
steps:
|
2020-08-05 12:50:59 -04:00
|
|
|
- name: Wait for CI/CT/CD to succeed
|
|
|
|
uses: fountainhead/action-wait-for-check@v1.0.0
|
|
|
|
id: wait-for-build
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
checkName: Deploy Docker Image - DEV
|
|
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
|
|
|
2020-07-21 10:53:31 -04:00
|
|
|
- name: merge
|
2020-08-05 12:50:59 -04:00
|
|
|
if: steps.wait-for-build.outputs.conclusion == 'success'
|
2020-07-22 02:07:25 -04:00
|
|
|
uses: actions/github-script@v2
|
2020-07-21 10:53:31 -04:00
|
|
|
with:
|
|
|
|
script: |
|
2020-08-04 12:05:11 -04:00
|
|
|
github.pulls.createReview({
|
2020-07-21 10:53:31 -04:00
|
|
|
owner: context.payload.repository.owner.login,
|
|
|
|
repo: context.payload.repository.name,
|
|
|
|
pull_number: context.payload.pull_request.number,
|
|
|
|
event: 'APPROVE'
|
|
|
|
})
|
2020-08-04 12:05:11 -04:00
|
|
|
github.pulls.merge({
|
2020-07-21 10:53:31 -04:00
|
|
|
owner: context.payload.repository.owner.login,
|
|
|
|
repo: context.payload.repository.name,
|
|
|
|
pull_number: context.payload.pull_request.number
|
|
|
|
})
|