Skip to content

Commit bce90fc

Browse files
committed
Add a check for dependencies sync to "Check Go" workflow
The dependencies definitions in go.mod and go.sum can become out of sync with the code. This can later result in a bad experience for casual contributors. So it's a good idea to configure the CI to check for this situation automatically.
1 parent bf9dc3f commit bce90fc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/check-go.yml

+17
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
paths:
77
- ".github/workflows/check-go.yml"
88
- "Taskfile.yml"
9+
- "go.mod"
10+
- "go.sum"
911
- "**.go"
1012
pull_request:
1113
paths:
1214
- ".github/workflows/check-go.yml"
1315
- "Taskfile.yml"
16+
- "go.mod"
17+
- "go.sum"
1418
- "**.go"
1519
schedule:
1620
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to tools.
@@ -69,3 +73,16 @@ jobs:
6973

7074
- name: Check formatting
7175
run: git diff --color --exit-code
76+
77+
check-config:
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- name: Checkout repository
82+
uses: actions/checkout@v2
83+
84+
- name: Run go mod tidy
85+
run: go mod tidy
86+
87+
- name: Check whether any tidying was needed
88+
run: git diff --color --exit-code

0 commit comments

Comments
 (0)