awesome_yourls/.github/workflows/auto-merge.yml

35 lines
958 B
YAML
Raw Normal View History

2021-09-14 22:31:38 +00:00
# https://docs.github.com/actions
2021-09-14 23:18:01 +00:00
name: Auto-merge
2021-09-14 22:31:38 +00:00
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
2021-09-14 23:18:01 +00:00
name: Dependabot
2021-09-14 22:31:38 +00:00
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
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-14 23:18:01 +00:00
run: gh pr merge --auto --rebase "$PR_URL"
2021-09-14 22:31:38 +00:00
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}