This repository has been archived on 2024-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
evolution-docs/res/ci/check-summary.sh

23 lines
495 B
Bash
Executable File

#!/bin/sh
ERROR=0
printf "\n\033[37;1m=> Checking SUMMARY.md\033[m\n"
cd src/ || exit 2
# summary is the list of files taken from SUMMARY.md - unused for now
summary="$( sed -e '/(/!d' -e 's/.*(//' -e 's/)//' ./SUMMARY.md )"
files="$( find . -type f -name '*.md' -not -name "SUMMARY.md" )"
for file in $files
do
if ! grep -q "$file" ./SUMMARY.md ; then
printf "::error title=Summary Lint,file=src/SUMMARY.md::$file not in SUMMARY.md\n"
ERROR=1
fi
done
exit $ERROR