2021-09-14 23:56:22 +02:00
|
|
|
# https://help.github.com/actions
|
|
|
|
|
2021-09-14 23:38:58 +02:00
|
|
|
name: Dependabot
|
|
|
|
|
|
|
|
on: pull_request_target
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
pull-requests: write
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
dependabot:
|
|
|
|
name: Auto-merge
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
|
|
|
steps:
|
|
|
|
- name: Dependabot metadata
|
|
|
|
id: dependabot-metadata
|
|
|
|
uses: dependabot/fetch-metadata@v1.1.1
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Approve a PR
|
2021-09-14 23:44:17 +02:00
|
|
|
if: steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
|
2021-09-14 23:38:58 +02:00
|
|
|
run: gh pr review --approve "$PR_URL"
|
|
|
|
env:
|
|
|
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Enable auto-merge for Dependabot PRs
|
2021-09-14 23:44:17 +02:00
|
|
|
run: gh pr merge --auto "$PR_URL"
|
2021-09-14 23:38:58 +02:00
|
|
|
env:
|
2021-09-14 23:44:17 +02:00
|
|
|
PR_URL: ${{ github.event.pull_request.html_url }}
|
2021-09-14 23:38:58 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|