-
-
Notifications
You must be signed in to change notification settings - Fork 109
33 lines (29 loc) · 1.31 KB
/
Copy pathauto-merge-dependabot.yml
File metadata and controls
33 lines (29 loc) · 1.31 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
# See https://docs.github.com/en/code-security/tutorials/secure-your-dependencies/automating-dependabot-with-github-actions#enabling-automerge-on-a-pull-request
name: Dependabot auto-merge patch updates
# We don't need to filter branches because we check
# if the PR is from dependabot
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
dependabot-auto-merge:
runs-on: ubuntu-latest
# Enable it if the PR is from dependabot and we are not on a fork
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'hibernate/hibernate-reactive'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
- name: Approve patch updates
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}