Fix tracability check
This commit is contained in:
parent
fa7cb6e908
commit
1e599627b5
@ -95,20 +95,28 @@ jobs:
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Check each file
|
# Check each file
|
||||||
MISSING_TRACES=0
|
# Pipe into the loop instead of a here-string (<<<) so this step works
|
||||||
while IFS= read -r file; do
|
# under POSIX sh/dash, not just bash. Use `case` instead of `[[ == ]]`
|
||||||
|
# for the same reason. The loop runs in a subshell (so a counter var
|
||||||
|
# wouldn't survive), so we record warnings in a temp file and count it
|
||||||
|
# afterwards.
|
||||||
|
MISSING_FILE=$(mktemp)
|
||||||
|
echo "$CHANGED" | while IFS= read -r file; do
|
||||||
# Skip test files
|
# Skip test files
|
||||||
if [[ "$file" == *".test."* ]]; then
|
case "$file" in
|
||||||
continue
|
*.test.*) continue ;;
|
||||||
fi
|
esac
|
||||||
|
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
if ! grep -q "TRACES:" "$file"; then
|
if ! grep -q "TRACES:" "$file"; then
|
||||||
echo "⚠️ Missing TRACES: $file"
|
echo "⚠️ Missing TRACES: $file"
|
||||||
MISSING_TRACES=$((MISSING_TRACES + 1))
|
echo "$file" >> "$MISSING_FILE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done <<< "$CHANGED"
|
done
|
||||||
|
|
||||||
|
MISSING_TRACES=$(wc -l < "$MISSING_FILE" | tr -d ' ')
|
||||||
|
rm -f "$MISSING_FILE"
|
||||||
|
|
||||||
if [ "$MISSING_TRACES" -gt 0 ]; then
|
if [ "$MISSING_TRACES" -gt 0 ]; then
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user