mirror of
https://github.com/Dasharo/docs.git
synced 2026-03-06 14:46:22 -08:00
20 lines
503 B
Bash
Executable File
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
|