-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (27 loc) · 970 Bytes
/
prevent-source-push.yml
File metadata and controls
32 lines (27 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Prevent Source Code Push
on:
push:
branches: [main]
pull_request:
jobs:
check-no-source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for source code
run: |
# Fail if Python files are found (except in .github)
if find . -name "*.py" -not -path "./.github/*" | grep -q .; then
echo "❌ ERROR: Python source files detected!"
echo "This repository should only contain binaries and documentation."
exit 1
fi
# Fail if source directories are found
for dir in qrew src source lib; do
if [ -d "$dir" ]; then
echo "❌ ERROR: Source directory '$dir' detected!"
echo "This repository should only contain binaries and documentation."
exit 1
fi
done
echo "✅ No source code detected - check passed"