Skip to content

Commit 5bd217f

Browse files
authored
[BUILD] Upgrade go dependencies using a custom github action (#195)
1 parent e659d88 commit 5bd217f

File tree

2 files changed

+75
-13
lines changed

2 files changed

+75
-13
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Update Go Dependencies
2+
3+
on:
4+
schedule:
5+
# Run every Monday at 9:00 AM UTC
6+
- cron: '0 9 * * 1'
7+
workflow_dispatch: # Allow manual trigger
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update-dependencies:
15+
name: Update Go Dependencies
16+
runs-on: ubuntu-24.04
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v5
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v6
24+
with:
25+
go-version: '1.25'
26+
27+
- name: Update Go dependencies
28+
run: make update-go-deps
29+
30+
- name: Tidy dependencies
31+
run: make tidy
32+
33+
- name: Generate manifests
34+
run: make generate manifests
35+
36+
- name: Format and lint fix
37+
run: make fmt lint-fix
38+
39+
- name: Check for changes
40+
id: check_changes
41+
run: |
42+
if [ -n "$(git status --porcelain)" ]; then
43+
echo "has_changes=true" >> $GITHUB_OUTPUT
44+
else
45+
echo "has_changes=false" >> $GITHUB_OUTPUT
46+
fi
47+
48+
- name: Create Pull Request
49+
if: steps.check_changes.outputs.has_changes == 'true'
50+
uses: peter-evans/create-pull-request@v7
51+
with:
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
commit-message: 'chore(deps): update Go dependencies'
54+
title: 'chore(deps): update Go dependencies'
55+
body: |
56+
## Automated Go Dependencies Update
57+
58+
This PR updates Go module dependencies to their latest versions.
59+
60+
### Changes made:
61+
- Updated Go module dependencies via `make update-go-deps`
62+
- Regenerated manifests via `make generate manifests`
63+
- Applied formatting and linting fixes via `make fmt lint-fix`
64+
65+
Please review the changes and ensure all tests pass before merging.
66+
branch: automated/update-go-deps
67+
delete-branch: true
68+
labels: |
69+
dependencies
70+
go
71+
automated
72+

renovate.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
"docker:enableMajor",
1515
"group:allDigest"
1616
],
17-
"postUpdateOptions": [
18-
"gomodTidy",
19-
"gomodUpdateImportPaths"
20-
],
17+
2118
"customManagers": [
2219
{
2320
"customType": "regex",
@@ -36,8 +33,8 @@
3633
"matchManagers": [
3734
"gomod"
3835
],
39-
"rangeStrategy": "replace",
40-
"description": "Prevent downgrades for all Go modules - only allow upgrades"
36+
"enabled": false,
37+
"description": "Disable Go module updates - handled by automated workflow: .github/workflows/update-go-deps.yml"
4138
},
4239
{
4340
"matchCategories": [
@@ -52,7 +49,6 @@
5249
"major"
5350
],
5451
"matchManagers": [
55-
"gomod",
5652
"github-actions",
5753
"maven",
5854
"dockerfile",
@@ -70,7 +66,6 @@
7066
"digest"
7167
],
7268
"matchManagers": [
73-
"gomod",
7469
"github-actions",
7570
"maven",
7671
"dockerfile",
@@ -79,11 +74,6 @@
7974
"helm-values",
8075
"docker"
8176
]
82-
},
83-
{
84-
"matchManagers": ["gomod"],
85-
"matchDepTypes": ["indirect"],
86-
"enabled": false
8777
}
8878
]
8979
}

0 commit comments

Comments
 (0)