You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: golang/README.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
This GitHub Action automatically updates Go module dependencies and creates a pull request with the changes.
4
4
5
5
> [!IMPORTANT]
6
-
> This action updates dependencies using `go get -u` and thus does not update to new major versions.
6
+
> This action updates dependencies using `go get -u`(by default) and thus does not update to new major versions. You can customize this behavior using the `strategy` input parameter.
7
7
8
8
## :rocket: Usage
9
9
@@ -24,6 +24,7 @@ jobs:
24
24
token: ${{ github.token }}
25
25
base-branch: 'main'
26
26
branch-prefix: 'update-go-deps'
27
+
strategy: 'controlled'# or 'direct', 'everything'
27
28
```
28
29
29
30
## :gear: Inputs
@@ -36,6 +37,40 @@ jobs:
36
37
| `pr-title` | Title for the pull request | :x: | `Update Golang Dependencies` |
37
38
| `commit-message` | Commit message for the update | :x: | `Update Golang dependencies` |
38
39
| `auto-merge` | Wether automatic merge should be enabled for the PR | :x: | `false` |
The `strategy` parameter controls how dependencies are updated:
45
+
46
+
### `controlled` (default)
47
+
48
+
Updates direct dependencies and their transitive dependencies while respecting version constraints. Uses `go get -t -u ./...` for a safe, tested update approach.
49
+
50
+
**Best for:** Most use cases where stability and compatibility are important.
51
+
52
+
### `direct`
53
+
54
+
Updates only direct dependencies (those explicitly listed in `go.mod`) to their latest versions, ignoring indirect dependencies.
55
+
56
+
```bash
57
+
go list -m -f '{{if not .Indirect}}{{.Path}}{{end}}' all \
58
+
| xargs -n1 go get -u
59
+
```
60
+
61
+
**Best for:** When you want to update only the dependencies you directly control.
62
+
63
+
### `everything`
64
+
65
+
Updates all dependencies, including indirect ones, to their latest available versions. This is the most aggressive strategy and may introduce breaking changes.
0 commit comments