File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ FORBIDDEN_DIR=" docs/unified-test-documentation"
4+
5+ # Get the list of files added in the current commit
6+ added_files=$( git diff --name-only --diff-filter=A master)
7+
8+ # Check if any added file is within the forbidden directory
9+ if [[ -n " $added_files " ]]; then
10+ for file in $added_files ; do
11+ if [[ " $file " == " $FORBIDDEN_DIR /" * ]]; then
12+ echo " Error: Files cannot be added to $FORBIDDEN_DIR "
13+ echo " Submit tests to the OSFV repo instead"
14+ exit 1
15+ fi
16+ done
17+ fi
18+
19+ exit 0
Original file line number Diff line number Diff line change 1+ ---
2+ name : Reject new tests
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ branches :
9+ - master
10+
11+ jobs :
12+ fail_on_test :
13+ runs-on : ubuntu-latest
14+ name : Reject new tests
15+ steps :
16+ - name : Checkout repo
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+ - run : .github/scripts/notests.sh
You can’t perform that action at this time.
0 commit comments