Skip to content

Commit

Permalink
Update go version checker (operator-framework#458)
Browse files Browse the repository at this point in the history
* Handle new files (old version is empty)
* Handle the case where .0 patch is added/removed

Signed-off-by: Todd Short <[email protected]>
  • Loading branch information
tmshort authored and camilamacedo86 committed Nov 18, 2024
1 parent 4d6327f commit d638fb8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions hack/scripts/check-go-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ for f in $(find . -name "*.mod"); do
old=${old#go }
new=$(git grep -ohP '^go .*$' "${f}")
new=${new#go }
# If ${old} is empty, it means this is a new .mod file
if [ -z "${old}" ]; then
continue
fi
# Check if patch version remains 0: X.x.0 <-> X.x
if [ "${new}.0" == "${old}" -o "${new}" == "${old}.0" ]; then
continue
fi
if [ "${new}" != "${old}" ]; then
echo "${f}: ${v}: Updated golang version from ${old}"
RETCODE=1
Expand Down

0 comments on commit d638fb8

Please sign in to comment.