Skip to content

Commit dd171aa

Browse files
committed
test
1 parent e1c3a80 commit dd171aa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.github/workflows/partials-audit.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,13 @@ jobs:
4848
echo " - SEARCH_FILE: $SEARCH_FILE"
4949
# --- END LOGGING ---
5050
51-
# Use a chained grep to find lines containing BOTH strings, regardless of order
52-
if ! grep -q -r --exclude-dir=.github --include="*.mdx" -e "$SEARCH_PRODUCT" -e "$SEARCH_FILE" .; then
51+
# This command checks if the combination of file and product exists.
52+
if ! perl -ne 'BEGIN{undef $/;} ($found=0); if (m/<Render.*?file="file".*?product="product".*?\/>/s) {$found=1;} print "FOUND\n" if $found; ' YourFile.mdx | grep -q 'FOUND'; then
5353
UNUSED_FILES+="$FILE\n"
5454
echo " -> UNUSED! Adding to list."
5555
else
5656
echo " -> Used. Skipping."
5757
fi
58-
echo "" # Add a blank line for readability
5958
done
6059
6160
# If there are unused files, output them

0 commit comments

Comments
 (0)