Skip to content

Commit b01b3e5

Browse files
committed
ci/gha: introduce step to check go.mod version
Introduce the step to validate if the go.mod is in conformance with Kubernetes project standard by using the patch version from the build env (ending with .0, x.y.0).
1 parent 37381a3 commit b01b3e5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/deps.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,24 @@ jobs:
4747
uses: golang/govulncheck-action@v1
4848
with:
4949
go-version-file: tests/e2e/go.mod
50+
go.mod dotzero check:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: "Checkout Repository"
54+
uses: actions/checkout@v4
55+
with:
56+
show-progress: false
57+
- name: "tests/e2e/go.mod must use Go version major.minor.0"
58+
env:
59+
GO_MOD_FILE: go.mod
60+
run: |
61+
test $(grep "^go " $GO_MOD_FILE | awk '{print $2}' | cut -d. -f3) != 0 && exit 1
62+
if: failure()
63+
fail-on-error: false
64+
- name: "tests/e2e/go.mod must use Go version major.minor.0"
65+
env:
66+
GO_MOD_FILE: tests/e2e/go.mod
67+
run: |
68+
test $(grep "^go " $GO_MOD_FILE | awk '{print $2}' | cut -d. -f3) != 0 && exit 1
69+
if: failure()
70+
fail-on-error: false

0 commit comments

Comments
 (0)