@@ -33,29 +33,34 @@ jobs:
3333 for FILE in $FILES; do
3434 # Get the relative path from src/content/partials/
3535 RELATIVE_PATH=${FILE#src/content/partials/}
36+ echo "RELATIVE_PATH: $RELATIVE_PATH"
3637 # Get the filename without extension
3738 FILENAME=$(basename "$RELATIVE_PATH" .mdx)
39+ echo "FILENAME: $FILENAME"
3840 # Get the product directory (first part of the path)
3941 PRODUCT_DIR=$(dirname "$RELATIVE_PATH")
40-
42+ echo "PRODUCT_DIR: $PRODUCT_DIR"
4143 FOUND=false
42-
44+
4345 # Search for Render components that reference this file
4446 # Look for files with explicit product parameter matching our product directory
4547 if grep -q -r -E "<Render[^>]*file=\"$FILENAME\"[^>]*product=\"$PRODUCT_DIR\"" --include="*.mdx" .; then
48+ echo "Found file: $FILENAME in product: $PRODUCT_DIR"
4649 FOUND=true
4750 fi
48-
51+
4952 # Look for files with explicit product parameter matching our product directory (reverse order)
5053 if grep -q -r -E "<Render[^>]*product=\"$PRODUCT_DIR\"[^>]*file=\"$FILENAME\"" --include="*.mdx" .; then
54+ echo "Found file: $FILENAME in product: $PRODUCT_DIR (reverse order)"
5155 FOUND=true
5256 fi
53-
57+
5458 # Look for files without product parameter in matching docs directory
5559 if grep -l -r -E "<Render[^>]*file=\"$FILENAME\"" --include="*.mdx" src/content/docs/$PRODUCT_DIR/ 2>/dev/null | grep -v -E "product=" | head -1 >/dev/null 2>&1; then
60+ echo "Found file: $FILENAME in docs directory: $PRODUCT_DIR"
5661 FOUND=true
5762 fi
58-
63+
5964 if [ "$FOUND" = false ]; then
6065 UNUSED_FILES+="$FILE\n"
6166 fi
7681 curl --silent -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
7782 -H "Accept: application/vnd.github+json" \
7883 "https://api.github.com/repos/cloudflare/cloudflare-docs/issues" \
79- -d "{\"title\": \"Unused Image Files Found\", \"body\": \"$(cat unused_files.txt)\", \"assignees\": [\"haleycode\"]}"
84+ -d "{\"title\": \"Unused Partials Files Found\", \"body\": \"$(cat unused_files.txt)\", \"assignees\": [\"haleycode\"]}"
0 commit comments