mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ci: ignore changes to comments or constants in versioned message check
These can be changed without version increment
This commit is contained in:
parent
b77797b490
commit
96461cdd7d
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user