Compare commits
4 Commits
daniel/tls
...
ENG-2659
Author | SHA1 | Date | |
---|---|---|---|
fb2e42f3b3 | |||
71c47b6460 | |||
cd1af71867 | |||
8fc9f198eb |
63
.github/workflows/docs-image-check.yml
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
name: Docs Image Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "docs/**"
|
||||
|
||||
jobs:
|
||||
docs-images:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check for unused images (warn only)
|
||||
run: |
|
||||
cd docs
|
||||
unused=0
|
||||
while IFS= read -r -d '' img; do
|
||||
img_name=$(basename "$img")
|
||||
img_path=${img#./}
|
||||
if ! grep -r --include="*.md" --include="*.mdx" --include="*.json" -e "$img_name" -e "$img_path" . > /dev/null; then
|
||||
echo "⚠️ Unused image found: $img"
|
||||
unused=1
|
||||
fi
|
||||
done < <(find . -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.gif" -o -iname "*.svg" \) -print0)
|
||||
|
||||
if [ "$unused" -eq 1 ]; then
|
||||
echo ""
|
||||
echo "⚠️ Some unused images were found."
|
||||
echo "👉 Run 'make clean-docs-images' locally to remove them."
|
||||
else
|
||||
echo "✅ No unused images found."
|
||||
fi
|
||||
|
||||
- name: Verify referenced images exist
|
||||
run: |
|
||||
cd docs
|
||||
missing=0
|
||||
while IFS= read -r -d '' file; do
|
||||
while IFS= read -r img_ref; do
|
||||
img_ref=$(echo "$img_ref" | sed 's/^(\(.*\))$/\1/')
|
||||
if [[ "$img_ref" == /* ]]; then
|
||||
real_path="./$img_ref"
|
||||
else
|
||||
real_path=$(echo "$img_ref" | sed 's|\(\.\./\)*|./|')
|
||||
fi
|
||||
if [ ! -f "$real_path" ]; then
|
||||
echo "❌ Missing image: $img_ref (referenced in $file)"
|
||||
missing=1
|
||||
fi
|
||||
done < <(grep -o -E "\([^()\"']*\.(png|jpg|jpeg|gif|svg)[^()\"']*\)" "$file" || true)
|
||||
done < <(find . -type f \( -iname "*.md" -o -iname "*.mdx" -o -iname "*.json" \) -print0)
|
||||
|
||||
if [ "$missing" -eq 1 ]; then
|
||||
echo ""
|
||||
echo "❌ Some referenced images are missing!"
|
||||
echo "Please fix the broken image references."
|
||||
exit 1
|
||||
else
|
||||
echo "✅ All referenced images exist."
|
||||
fi
|
31
Makefile
@ -33,3 +33,34 @@ reviewable: reviewable-ui reviewable-api
|
||||
|
||||
up-dev-sso:
|
||||
docker compose -f docker-compose.dev.yml --profile sso up --build
|
||||
|
||||
# Remove any unused images in docs | WARNING: Only verifies image existence in .md, .mdx, and .json
|
||||
# To see every file type in docs, run: find ./docs -type f -name "*.*" | grep -o '\.[^./]*$' | sort -u
|
||||
clean-docs-images:
|
||||
cd docs && \
|
||||
find . -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.gif" -o -iname "*.svg" \) -print0 | \
|
||||
while IFS= read -r -d '' img; do \
|
||||
img_name=$$(basename "$$img"); \
|
||||
img_path=$${img#./}; \
|
||||
if ! grep -r --include="*.md" --include="*.mdx" --include="*.json" -e "$$img_name" -e "$$img_path" . > /dev/null; then \
|
||||
echo "Removing unused image: $$img"; \
|
||||
rm "$$img"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Verifies that any images referenced in any ./docs files actually exist
|
||||
verify-image-refs:
|
||||
cd docs && \
|
||||
find . -type f \( -iname "*.md" -o -iname "*.mdx" -o -iname "*.json" \) -print0 | \
|
||||
xargs -0 -I{} grep -o -E "\([^()\"']*\.(png|jpg|jpeg|gif|svg)[^()\"']*\)" {} 2>/dev/null | \
|
||||
sort -u | while read -r img_ref; do \
|
||||
img_ref=$$(echo "$$img_ref" | sed 's/^(\(.*\))$$/\1/'); \
|
||||
if [[ "$$img_ref" == /* ]]; then \
|
||||
real_path="./$$img_ref"; \
|
||||
else \
|
||||
real_path=$$(echo "$$img_ref" | sed 's|\(\.\./\)*|./|'); \
|
||||
fi; \
|
||||
if [ ! -f "$$real_path" ]; then \
|
||||
echo "Missing image: $$img_ref"; \
|
||||
fi; \
|
||||
done
|
||||
|
Before Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 278 KiB |
Before Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 249 KiB |
Before Width: | Height: | Size: 472 KiB |
Before Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 340 KiB |
Before Width: | Height: | Size: 232 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 217 KiB |
Before Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 523 KiB |
Before Width: | Height: | Size: 323 KiB |
Before Width: | Height: | Size: 528 KiB |
Before Width: | Height: | Size: 160 KiB |
Before Width: | Height: | Size: 343 KiB |
Before Width: | Height: | Size: 219 KiB |
Before Width: | Height: | Size: 377 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 343 KiB |
Before Width: | Height: | Size: 220 KiB |
Before Width: | Height: | Size: 580 KiB |
Before Width: | Height: | Size: 377 KiB |
Before Width: | Height: | Size: 355 KiB |
Before Width: | Height: | Size: 418 KiB |
Before Width: | Height: | Size: 795 KiB |
Before Width: | Height: | Size: 835 KiB |
Before Width: | Height: | Size: 444 KiB |
Before Width: | Height: | Size: 503 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 511 KiB |
Before Width: | Height: | Size: 493 KiB |
Before Width: | Height: | Size: 352 KiB |
Before Width: | Height: | Size: 706 KiB |
Before Width: | Height: | Size: 245 KiB |
Before Width: | Height: | Size: 472 KiB |
Before Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 656 KiB |
Before Width: | Height: | Size: 760 KiB |
Before Width: | Height: | Size: 878 KiB |
Before Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 370 KiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 940 KiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 893 KiB |
Before Width: | Height: | Size: 992 KiB |
Before Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 268 KiB |
Before Width: | Height: | Size: 87 KiB |
Before Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 186 KiB |
Before Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 229 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 936 KiB |
Before Width: | Height: | Size: 942 KiB |
Before Width: | Height: | Size: 1.5 MiB |
Before Width: | Height: | Size: 218 KiB |
Before Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 241 KiB |
Before Width: | Height: | Size: 202 KiB |
Before Width: | Height: | Size: 301 KiB |
Before Width: | Height: | Size: 220 KiB |
Before Width: | Height: | Size: 345 KiB |
Before Width: | Height: | Size: 909 KiB |
Before Width: | Height: | Size: 801 KiB |
Before Width: | Height: | Size: 908 KiB |
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 930 KiB |
Before Width: | Height: | Size: 443 KiB |
Before Width: | Height: | Size: 467 KiB |
Before Width: | Height: | Size: 234 KiB |
Before Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 671 KiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 870 KiB |
Before Width: | Height: | Size: 478 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 436 KiB |
Before Width: | Height: | Size: 197 KiB |
Before Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 313 KiB |