Skip to content

Commit f652325

Browse files
committed
.github/workflows/notests.yml: add workflow
Signed-off-by: Michał Kopeć <[email protected]>
1 parent d50e823 commit f652325

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/scripts/notests.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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

.github/workflows/notests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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

0 commit comments

Comments
 (0)