Skip to content

Commit fb81230

Browse files
Increase Dependabot update freq. Auto-merge Dependabot PRs if they are updates to patch versions. (#409)
1 parent 35c4625 commit fb81230

File tree

2 files changed

+75
-2
lines changed

2 files changed

+75
-2
lines changed

.github/dependabot.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
version: 2
66
enable-beta-ecosystems: true
77
updates:
8-
98
# Enable version updates for Go modules
109
- package-ecosystem: "gomod"
1110
directory: "/"
11+
# Only update patch versions to reduce the chance of regressions getting introduced
12+
ignore:
13+
- dependency-name: "*"
14+
update-types:
15+
- "version-update:semver-major"
16+
- "version-update:semver-minor"
1217
schedule:
1318
interval: "monthly"
1419
commit-message:
@@ -31,6 +36,12 @@ updates:
3136
- "/pod-configs/module/application-load-balancer"
3237
- "/pod-configs/module/load-balancer"
3338
- "/pod-configs/buckets"
39+
# Only update patch versions to reduce the chance of regressions getting introduced
40+
ignore:
41+
- dependency-name: "*"
42+
update-types:
43+
- "version-update:semver-major"
44+
- "version-update:semver-minor"
3445
schedule:
3546
interval: "monthly"
3647
commit-message:
@@ -46,6 +57,12 @@ updates:
4657
- "/argocd-internal/root-app"
4758
- "/argocd/applications"
4859
- "/argocd/root-app"
60+
# Only update patch versions to reduce the chance of regressions getting introduced
61+
ignore:
62+
- dependency-name: "*"
63+
update-types:
64+
- "version-update:semver-major"
65+
- "version-update:semver-minor"
4966
schedule:
5067
interval: "monthly"
5168
commit-message:
@@ -58,17 +75,29 @@ updates:
5875
- package-ecosystem: "docker"
5976
directories:
6077
- "/installer"
78+
# Only update patch versions to reduce the chance of regressions getting introduced
79+
ignore:
80+
- dependency-name: "*"
81+
update-types:
82+
- "version-update:semver-major"
83+
- "version-update:semver-minor"
6184
schedule:
6285
interval: "monthly"
6386
commit-message:
6487
prefix: "Dockerfile"
6588
reviewers:
6689
- "se-chris-thach"
6790
- "dmytroye"
68-
91+
6992
# Enable version updates for GitHub Actions
7093
- package-ecosystem: "github-actions"
7194
directory: "/"
95+
# Only update patch versions to reduce the chance of regressions getting introduced
96+
ignore:
97+
- dependency-name: "*"
98+
update-types:
99+
- "version-update:semver-major"
100+
- "version-update:semver-minor"
72101
schedule:
73102
interval: "monthly"
74103
commit-message:

.github/workflows/dependabot.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# SPDX-FileCopyrightText: 2025 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
---
5+
name: Dependabot auto-approve and auto-merge PR
6+
7+
on:
8+
# Trigger workflow on PRs to all branches
9+
pull_request:
10+
branches:
11+
- "*"
12+
types:
13+
- opened
14+
- synchronize
15+
- reopened
16+
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
21+
jobs:
22+
dependabot:
23+
runs-on: ubuntu-latest
24+
if: github.event.pull_request.user.login == 'dependabot[bot]'
25+
steps:
26+
- name: Dependabot metadata
27+
id: metadata
28+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
29+
with:
30+
github-token: "${{ secrets.GITHUB_TOKEN }}"
31+
32+
- name: Approve Dependabot PR
33+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
34+
run: gh pr review --approve "$PR_URL"
35+
env:
36+
PR_URL: ${{github.event.pull_request.html_url}}
37+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
38+
39+
- name: Enable auto-merge for Dependabot PR
40+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
41+
run: gh pr merge --auto --squash "$PR_URL"
42+
env:
43+
PR_URL: ${{github.event.pull_request.html_url}}
44+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)