Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/scripts/notests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/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
20 changes: 20 additions & 0 deletions .github/workflows/notests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Reject new tests
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
fail_on_test:
runs-on: ubuntu-latest
name: Reject new tests
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: .github/scripts/notests.sh