ci: ignore changes to comments or constants in versioned message check

These can be changed without version increment
This commit is contained in:
Beat Küng 2025-02-13 11:49:08 +01:00 committed by Silvan Fuhrer
parent b77797b490
commit 96461cdd7d

View File

@ -26,6 +26,15 @@ do
# - Incrementing the version
# - An old .msg version exists
# - A translation header exists and is included
# Ignore changes to comments or constants
content_a=$(git show "${BASE_COMMIT}:${file}" | grep -o '^[^#]*' | grep -v =)
content_b=$(git show "${HEAD_COMMIT}:${file}" | grep -o '^[^#]*' | grep -v =)
if [ "${content_a}" == "${content_b}" ]; then
echo "No version update required for ${file}"
continue
fi
diff=$(git --no-pager diff --no-color --diff-filter=M "${BASE_COMMIT}"..."${HEAD_COMMIT}" -- "${file}")
old_version=$(echo "${diff}" | sed -n 's/^-uint32 MESSAGE_VERSION = \([0-9]*\).*/\1/p')
new_version=$(echo "${diff}" | sed -n 's/^+uint32 MESSAGE_VERSION = \([0-9]*\).*/\1/p')