-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.19 KB
/
dependabot-automations.yaml
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
name: Dependabot Automations
on:
pull_request_target:
types: [opened, synchronize, reopened]
workflow_call:
inputs:
autoApprove:
default: false
type: boolean
autoMerge:
default: false
type: boolean
jobs:
dependabot-automations:
name: Dependabot Automations
runs-on: ubuntu-latest
if: ${{ inputs.autoApprove || inputs.autoMerge }}
steps:
- name: Checkout
uses: actions/checkout@v3
# The approval step will fail if there's no metadata.
- name: Retrieve dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
uses: hmarr/auto-approve-action@v3.2.1
if: ${{ inputs.autoApprove }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge
if: ${{ inputs.autoMerge && 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.GITHUB_TOKEN}}