@@ -131,15 +131,16 @@ jobs:
131131 else
132132 echo -e "\033[32mFile contains a custom:version tag\033[0m"
133133
134- # First, check if there are any relevant changes besides the version tag itself.
135- # This prevents the action from demanding a version bump if only comments were changed.
134+ ##### Filter relevant code changes (exclude comments, pragma, license, empty lines)
136135 DIFF_OUTPUT=$(git diff "origin/${{ github.event.pull_request.base.ref }}" HEAD -- "$FILE_PATH")
137136 RELEVANT_CHANGES=$(echo "$DIFF_OUTPUT" | grep -E '^[\+\-]' \
138- | grep -vE "^[\+\-][[:space:]]*(//|/\*|\*| pragma|/// @custom:version )" \
137+ | grep -vE "^[\+\-][[:space:]]*(//|/\*|pragma)" \
139138 | grep -vE '^(\+\+\+|---)' \
140139 | grep -vE '^([\+\-])[[:space:]]*$' || true)
141140
141+ ##### Decide if audit/version update is needed
142142 if [[ -n "$RELEVANT_CHANGES" ]]; then
143+ ##### Log what is considered relevant (if anything)
143144 echo "--------------------"
144145 echo "The following lines were identified as audit-relevant code changes:"
145146 echo "$RELEVANT_CHANGES"
@@ -177,12 +178,12 @@ jobs:
177178 echo -e "\033[32m$FILE_PATH is an interface and does not require any audit.\033[0m"
178179 fi
179180 else
180- # The version number is the same, but the code changed. This is an error.
181+ ##### Relevant changes but no version update — needs fixing
181182 echo -e "\033[31mThe file has relevant changes but the version (v${VERSION}) was not updated.\033[0m"
182183 MISSING_VERSION_UPDATE+=("$FILE_PATH")
183184 fi
184185 else
185- # No relevant changes were found.
186+ ##### No relevant changes — only comments or pragma touched
186187 echo -e "\033[32mChange is non-relevant (only comments or pragma). No version update required.\033[0m"
187188 fi
188189 fi
0 commit comments