Skip to content

Commit 8796527

Browse files
CopilotthomasturrellCopilot
authored
Automate Dependabot minor/patch PR approvals & merges (#476)
* Initial plan * Add Dependabot automation for minor/patch updates - Updated dependabot.yml with auto-merge-minor-and-patch groups for both maven and github-actions ecosystems - Created dependabot-auto-approve.yml workflow to automatically approve minor and patch updates - Created dependabot-auto-merge.yml workflow to automatically merge approved minor and patch PRs - Extracted all external dependencies from pom files and added them to the configuration in alphabetical order --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Thomas Turrell-Croft <thomasturrell@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6bee67d commit 8796527

3 files changed

Lines changed: 109 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,65 @@ updates:
88
- package-ecosystem: "maven" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: "daily"
1212
reviewers:
1313
- "berrycloud/reviewers"
14+
groups:
15+
auto-merge-minor-and-patch:
16+
update-types:
17+
- "minor"
18+
- "patch"
19+
patterns:
20+
- "com.h2database:h2"
21+
- "com.jayway.jsonpath:json-path-assert"
22+
- "com.puppycrawl.tools:checkstyle"
23+
- "com.squareup.okhttp3:mockwebserver"
24+
- "com.squareup.okhttp3:okhttp"
25+
- "com.squareup.okhttp3:okhttp-bom"
26+
- "io.hypersistence:hypersistence-utils-hibernate-70"
27+
- "io.jsonwebtoken:jjwt-api"
28+
- "io.jsonwebtoken:jjwt-impl"
29+
- "io.jsonwebtoken:jjwt-jackson"
30+
- "io.netty:netty-resolver-dns-native-macos"
31+
- "jakarta.validation:jakarta.validation-api"
32+
- "org.apache.maven.plugins:maven-checkstyle-plugin"
33+
- "org.apache.maven.plugins:maven-compiler-plugin"
34+
- "org.apache.maven.plugins:maven-failsafe-plugin"
35+
- "org.apache.maven.plugins:maven-gpg-plugin"
36+
- "org.apache.maven.plugins:maven-javadoc-plugin"
37+
- "org.apache.maven.plugins:maven-release-plugin"
38+
- "org.apache.maven.plugins:maven-source-plugin"
39+
- "org.apache.maven.plugins:maven-surefire-plugin"
40+
- "org.eclipse.m2e:lifecycle-mapping"
41+
- "org.hibernate.validator:hibernate-validator"
42+
- "org.jacoco:jacoco-maven-plugin"
43+
- "org.projectlombok:lombok"
44+
- "org.sonatype.central:central-publishing-maven-plugin"
45+
- "org.springframework.boot:spring-boot-autoconfigure"
46+
- "org.springframework.boot:spring-boot-devtools"
47+
- "org.springframework.boot:spring-boot-jackson2"
48+
- "org.springframework.boot:spring-boot-starter-data-jpa"
49+
- "org.springframework.boot:spring-boot-starter-parent"
50+
- "org.springframework.boot:spring-boot-starter-test"
51+
- "org.springframework.boot:spring-boot-starter-validation"
52+
- "org.springframework.boot:spring-boot-starter-web"
53+
- "org.springframework.boot:spring-boot-starter-webflux"
54+
- "org.springframework.boot:spring-boot-webmvc-test"
55+
- "org.springframework.integration:spring-integration-test"
1456
- package-ecosystem: "github-actions"
1557
directory: "/"
1658
schedule:
1759
interval: "weekly"
60+
groups:
61+
auto-merge-minor-and-patch:
62+
update-types:
63+
- "minor"
64+
- "patch"
65+
patterns:
66+
- "actions/checkout"
67+
- "actions/create-github-app-token"
68+
- "actions/setup-java"
69+
- "actions/stale"
70+
- "advanced-security/maven-dependency-submission-action"
71+
- "dependabot/fetch-metadata"
72+
- "github/codeql-action"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Dependabot Auto-Approve
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
auto-approve:
12+
runs-on: ubuntu-latest
13+
if: github.event.pull_request.user.login == 'dependabot[bot]'
14+
steps:
15+
- name: Get Dependabot metadata
16+
id: metadata
17+
uses: dependabot/fetch-metadata@v2
18+
with:
19+
github-token: "${{ github.token }}"
20+
- name: Approve minor and patch updates
21+
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
22+
run: |
23+
gh pr review --approve "$PR_URL"
24+
env:
25+
PR_URL: ${{ github.event.pull_request.html_url }}
26+
GH_TOKEN: ${{ github.token }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Dependabot Auto-Merge
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
auto-merge:
13+
runs-on: ubuntu-latest
14+
if: github.event.review.state == 'approved' && github.event.pull_request.user.login == 'dependabot[bot]'
15+
steps:
16+
- name: Get Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@v2
19+
with:
20+
github-token: "${{ github.token }}"
21+
- name: Enable auto-merge for minor and patch updates
22+
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
23+
run: |
24+
gh pr merge --auto --squash "$PR_URL"
25+
env:
26+
PR_URL: ${{ github.event.pull_request.html_url }}
27+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)