Files
docs/.github/scripts/notests.sh
Michał Kopeć f26fa9e826 .github/workflows/notests.yml: add workflow
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2025-04-01 17:25:51 +02:00

20 lines
503 B
Bash
Executable File

#!/bin/bash
FORBIDDEN_DIR="docs/unified-test-documentation"
# Get the list of files added in the current commit
added_files=$(git diff --name-only --diff-filter=A origin/master)
# Check if any added file is within the forbidden directory
if [[ -n "$added_files" ]]; then
for file in $added_files; do
if [[ "$file" == "$FORBIDDEN_DIR/"* ]]; then
echo "Error: Files cannot be added to $FORBIDDEN_DIR"
echo "Submit tests to the OSFV repo instead"
exit 1
fi
done
fi
exit 0