Skip to content

Commit 7e6f03b

Browse files
committed
chore: replace Dependabot with custom script
Dependabot doesn't properly tidy Go dependencies across the repository and lacks customization options. We've replaced it with a custom script that correctly updates and tidies dependencies on a weekly schedule. Signed-off-by: Michael Gasch <[email protected]>
1 parent 5b0a070 commit 7e6f03b

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: gomod
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 5
83
- package-ecosystem: "github-actions"
94
directory: "/"
105
schedule:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Update Dependencies
2+
3+
on:
4+
schedule:
5+
# Runs every Monday at 3:00 AM UTC
6+
- cron: '0 3 * * 1'
7+
# Allow manual triggering
8+
workflow_dispatch:
9+
10+
jobs:
11+
update-dependencies:
12+
strategy:
13+
matrix:
14+
go-version: [1.23]
15+
platform: [ubuntu-latest]
16+
runs-on: ${{ matrix.platform }}
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
25+
- name: Setup Go ${{ matrix.go-version }}
26+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
27+
with:
28+
go-version: ${{ matrix.go-version }}
29+
cache-dependency-path: v2/go.sum
30+
id: go
31+
32+
- name: Run update dependencies script
33+
run: |
34+
chmod +x ./hack/update-deps.sh
35+
./hack/update-deps.sh
36+
37+
- name: Check for changes
38+
id: check-changes
39+
run: |
40+
if [[ -n "$(git status --porcelain '**/go.mod' '**/go.sum')" ]]; then
41+
echo "changes=true" >> $GITHUB_OUTPUT
42+
else
43+
echo "changes=false" >> $GITHUB_OUTPUT
44+
fi
45+
46+
- name: Create Pull Request
47+
if: steps.check-changes.outputs.changes == 'true'
48+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
49+
with:
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
commit-message: "chore: update dependencies"
52+
title: "chore: update dependencies"
53+
body: |
54+
This PR updates Go dependencies.
55+
56+
This is an automated PR created by the weekly dependency update workflow.
57+
branch: automated-dependency-updates
58+
delete-branch: true
59+
labels: deps,chore
60+
reviewers: sdk-go-maintainers

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This library will help you to:
2020
_Note:_ Supported
2121
[CloudEvents specification](https://github.com/cloudevents/spec): 0.3, 1.0
2222

23-
_Note:_ Supported go version: 1.22+
23+
_Note:_ Tested and supported go version(s): 1.23+
2424

2525
## Get started
2626

0 commit comments

Comments
 (0)