Skip to content

Commit d4ebf99

Browse files
authored
build(go): Check if go.mod and go.sum are up to dated (#1377)
This commit is to add job to check if go.mod and go.sum are up to date. Also add go.sum into .gitattributes so that it will be considered as generated file in PR review. Signed-off-by: Tam Mach <sayboras@yahoo.com>
1 parent 5efb842 commit d4ebf99

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go.sum linguist-generated

.github/workflows/pr.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ on:
88
- master
99
pull_request:
1010
jobs:
11+
# Check if there any dirty change for go mod tidy
12+
go-mod:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Install Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.15
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
- name: Check go mod
22+
run: |
23+
go mod tidy
24+
git diff --exit-code
25+
1126
# We already run the current golangci-lint in tests, but here we test
1227
# our GitHub action with the latest stable golangci-lint.
1328
golangci-lint:

0 commit comments

Comments
 (0)