server-configs-nginx/.github/workflows/auto-merge.yml

35 lines
958 B
YAML
Raw Normal View History

2021-09-15 01:31:21 +02:00
# https://docs.github.com/actions
2021-09-15 00:14:53 +02:00
2021-09-15 01:31:21 +02:00
name: Auto-merge
2021-09-15 00:14:53 +02:00
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
2021-09-15 01:31:21 +02:00
name: Dependabot
2021-09-15 00:14:53 +02:00
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.3.3
2021-09-15 00:14:53 +02:00
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve a PR
if: steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major'
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-15 01:31:21 +02:00
run: gh pr merge --auto --rebase "$PR_URL"
2021-09-15 00:14:53 +02:00
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}