-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.3 KB
/
dependabot.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
41
42
43
name: Dependabot
on:
workflow_call:
secrets:
pr_approve_and_merge_pat:
description: Branch protection with CODEOWNERS require use of a PAT with write access to the repo to approve and merge PRs
required: true
permissions: {}
jobs:
dependabot:
name: Pull request approve and merge
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
# Fetch Metadata from Dependabot PRs
# https://github.com/marketplace/actions/fetch-metadata-from-dependabot-prs
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.pr_approve_and_merge_pat }}"
# GitHub command line
# https://cli.github.com
- name: Pull request approve
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: "${{ secrets.pr_approve_and_merge_pat }}"
- name: Pull request merge
if: ${{ 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.pr_approve_and_merge_pat }}"