-
Notifications
You must be signed in to change notification settings - Fork 446
43 lines (36 loc) · 1.1 KB
/
automerge-dependabot.yml
File metadata and controls
43 lines (36 loc) · 1.1 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
32
33
34
35
36
37
38
39
40
41
42
43
name: Auto-merge Dependabot PRs
on:
pull_request_target:
branches: [main]
jobs:
#
# Automatically review dependabot PRs and set them to automerge (on successful checks)
#
Automerge:
environment:
name: PR Backport
runs-on: ubuntu-slim
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'Unidata/MetPy'
env:
GH_REPO: ${{ github.repository }}
GH_PR: ${{ github.event.pull_request.number }}
permissions:
contents: write
pull-requests: write
steps:
- name: Check Dependabot metadata
uses: dependabot/fetch-metadata@v2
- name: Create App Token
uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Set auto-merge
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr merge -R "$GH_REPO" --merge --auto "$GH_PR"
- name: Review PR
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: gh pr review -R "$GH_REPO" --approve "$GH_PR"