File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ function check() {
69
69
fi
70
70
71
71
if [[ $update = true && " $mismatch " != " " ]]; then
72
+ # Detect if the line includes a patch version
73
+ if [[ " $go_version " =~ $version_regex \. [0-9]+ ]]; then
74
+ echo " Patch version detected in $file . Manual update required."
75
+ exit 1
76
+ fi
72
77
update " $file " " $pattern " " $go_version " " $target "
73
78
mismatch=" *** => $target ***"
74
79
fi
@@ -79,7 +84,26 @@ function check() {
79
84
check go.mod " ^go\s\+$version_regex " " $go_previous_version "
80
85
check internal/tools/go.mod " ^go\s\+$version_regex " " $go_latest_version "
81
86
82
- check docker/debug/Dockerfile " ^.*golang:$version_regex " " $go_latest_version "
87
+ # Patch Version Handling in Dockerfile
88
+ check_dockerfile () {
89
+ local file=$1
90
+ local pattern=$2
91
+ local target=$3
92
+
93
+ go_version=$( grep -e " $pattern " " $file " | head -1 | sed " s/^.*golang:\($version_regex \.[0-9]*\).*$/\1/" )
94
+
95
+ if [[ " $go_version " != " $target " ]]; then
96
+ if [[ " $go_version " =~ $version_regex \. [0-9]+ ]]; then
97
+ echo " Patch version detected in $file ($go_version ). Manual update required."
98
+ exit 1
99
+ fi
100
+ files_to_update=$(( files_to_update+ 1 ))
101
+ fi
102
+
103
+ printf " %-50s Go version: %s %s\n" " $file " " $go_version " " ${mismatch:- } "
104
+ }
105
+
106
+ check_dockerfile docker/debug/Dockerfile " ^.*golang:$version_regex " " $go_latest_version "
83
107
84
108
IFS=' |' read -r -a gha_workflows <<< " $(grep -rl go-version .github | tr '\n' '|')"
85
109
for gha_workflow in " ${gha_workflows[@]} " ; do
You can’t perform that action at this time.
0 commit comments