-
Notifications
You must be signed in to change notification settings - Fork 6
31 lines (27 loc) · 1.2 KB
/
dependabot-auto-merge.yml
File metadata and controls
31 lines (27 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Dependabot auto-merge
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
activate-auto-merge:
runs-on: ubuntu-latest
if: ${{github.actor == 'dependabot[bot]' || github.actor == 'otto-the-bot'}}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2.5.0
with:
github-token: '${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}'
- name: Approve a PR
if: ${{ github.actor == 'otto-the-bot' || (github.actor == 'dependabot[bot]' && 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.WEBTEAM_AUTOMERGE_TOKEN}}'
- name: Enable auto-merge for Dependabot PRs
if: ${{ github.actor == 'otto-the-bot' || (github.actor == 'dependabot[bot]' && steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major') }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: '${{secrets.WEBTEAM_AUTOMERGE_TOKEN}}'