| 166 |
lars |
1 |
name: dependabot-auto-merge
|
|
|
2 |
on: pull_request_target
|
|
|
3 |
|
|
|
4 |
permissions:
|
|
|
5 |
pull-requests: write
|
|
|
6 |
contents: write
|
|
|
7 |
|
|
|
8 |
jobs:
|
|
|
9 |
dependabot:
|
|
|
10 |
runs-on: ubuntu-latest
|
|
|
11 |
if: ${{ github.actor == 'dependabot[bot]' }}
|
|
|
12 |
steps:
|
|
|
13 |
|
|
|
14 |
- name: Dependabot metadata
|
|
|
15 |
id: metadata
|
|
|
16 |
uses: dependabot/fetch-metadata@v1.3.5
|
|
|
17 |
with:
|
|
|
18 |
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
19 |
compat-lookup: true
|
|
|
20 |
|
|
|
21 |
- name: Auto-merge Dependabot PRs for semver-minor updates
|
|
|
22 |
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
|
|
|
23 |
run: gh pr merge --auto --merge "$PR_URL"
|
|
|
24 |
env:
|
|
|
25 |
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
26 |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
27 |
|
|
|
28 |
- name: Auto-merge Dependabot PRs for semver-patch updates
|
|
|
29 |
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
|
|
|
30 |
run: gh pr merge --auto --merge "$PR_URL"
|
|
|
31 |
env:
|
|
|
32 |
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
33 |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
|
34 |
|
|
|
35 |
- name: Auto-merge Dependabot PRs for Action major versions when compatibility is higher than 90%
|
|
|
36 |
if: ${{steps.metadata.outputs.package-ecosystem == 'github_actions' && steps.metadata.outputs.update-type == 'version-update:semver-major' && steps.metadata.outputs.compatibility-score >= 90}}
|
|
|
37 |
run: gh pr merge --auto --merge "$PR_URL"
|
|
|
38 |
env:
|
|
|
39 |
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
40 |
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|