File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,23 @@ permissions:
99 contents : read
1010
1111jobs :
12+ go-version :
13+ name : Check Go version consistency
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Harden Runner
17+ uses : step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
18+ with :
19+ egress-policy : audit
20+
21+ - name : checkout
22+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
23+ with :
24+ persist-credentials : false
25+
26+ - name : Check Go version consistency
27+ run : make check-go-version
28+
1229 pr-short-tests :
1330 name : Run short go tests
1431 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 11.DEFAULT : all
2- .PHONY : all clean install-tools dev-image release dev-manifest e2e-test minikube-publish test lint lint-go lint-sh lint-ghactions lint-docs
2+ .PHONY : all clean install-tools dev-image release dev-manifest e2e-test minikube-publish test lint lint-go lint-sh lint-ghactions lint-docs check-go-version
33
44REGISTRY ?= ghcr.io
55IMAGE_NAME ?= kubereboot/kured
@@ -54,6 +54,15 @@ test: lint
5454
5555lint : lint-sh lint-ghactions lint-go
5656
57+ check-go-version :
58+ @echo " Checking Go version consistency"
59+ @go_version=" $$ (sed -nE 's/^go[[:space:]]+([0-9]+\.[0-9]+\.[0-9]+)[[:space:]]*$$ /\1/p' go.mod)" ; \
60+ mise_version=" $$ (sed -nE 's/^go[[:space:]]*=[[:space:]]*" ([0-9]+\. [0-9]+\. [0-9]+)" [[:space:]]*$$ /\1/p' .config/mise.toml)" ; \
61+ if [ -z " $$ go_version" ] || [ -z " $$ mise_version" ] || [ " $$ go_version" != " $$ mise_version" ]; then \
62+ echo " Go version mismatch or invalid format: go.mod=$$ {go_version:-invalid}, .config/mise.toml=$$ {mise_version:-invalid}" >&2 ; \
63+ exit 1; \
64+ fi
65+
5766lint-sh :
5867 @echo " Running shellcheck"
5968 find . -name ' *.sh' | xargs -n1 shellcheck
@@ -72,4 +81,5 @@ lint-docs:
7281
7382lint-goreleaser :
7483 @echo " Checking goreleaser"
75- goreleaser check
84+ goreleaser check
85+
You can’t perform that action at this time.
0 commit comments