File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ check_version () {
32
32
echo " ${file} : ${whole} : Bad golang version (expected ${GO_VER} or less)"
33
33
return 1
34
34
fi
35
-
35
+
36
36
if [ ${# ver[*]} -eq 2 ] ; then
37
37
return 0
38
38
fi
@@ -63,8 +63,15 @@ for f in $(find . -name "*.mod"); do
63
63
old=${old# go }
64
64
new=$( git grep -ohP ' ^go .*$' " ${f} " )
65
65
new=${new# go }
66
- # If ${old} is empty, it means this is a new file
67
- if [ " ${new} " != " ${old} " -a -n " ${old} " ]; then
66
+ # If ${old} is empty, it means this is a new .mod file
67
+ if [ -z " ${old} " ]; then
68
+ continue
69
+ fi
70
+ # Check if patch version remains 0: X.x.0 <-> X.x
71
+ if [ " ${new} .0" == " ${old} " -o " ${new} " == " ${old} .0" ]; then
72
+ continue
73
+ fi
74
+ if [ " ${new} " != " ${old} " ]; then
68
75
echo " ${f} : ${v} : Updated golang version from ${old} "
69
76
RETCODE=1
70
77
fi
You can’t perform that action at this time.
0 commit comments