-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.25 KB
/
dependabot-auto-merge.yml
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
32
33
34
35
36
37
38
39
40
name: "Dependabot Auto Merge"
on:
pull_request: ~
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
runs-on: ubuntu-22.04
if: github.actor == 'dependabot[bot]'
steps:
# https://github.com/marketplace/actions/create-github-app-token
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1.11.0
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
# https://github.com/marketplace/actions/fetch-metadata-from-dependabot-prs
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ steps.app-token.outputs.token }}"
- name: Enable auto-merge for Dependabot PRs
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
PR_TITLE: ${{ github.event.pull_request.title }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}