Skip to content

Commit 541ac41

Browse files
committed
made parent.yml super simple
1 parent 2f762d1 commit 541ac41

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/parent.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
security-scan:
9+
name: Security & Quality Check
10+
runs-on: ubuntu-latest
11+
permissions:
12+
actions: read
13+
contents: read
14+
security-events: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.x'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
30+
- name: Check Python syntax
31+
run: |
32+
python -m py_compile $(find . -name "*.py" -not -path "./.git/*")
33+
34+
- name: Basic security checks
35+
run: |
36+
echo "Checking for potential issues..."
37+
38+
# Check for hardcoded secrets
39+
if grep -r -i -E "(password|secret|key|token)\s*=\s*['\"][^'\"]{8,}" --include="*.py" . ; then
40+
echo "⚠️ Potential hardcoded secrets found!"
41+
exit 1
42+
fi
43+
44+
# Check for dangerous functions
45+
if grep -r -E "(eval|exec)\s*\(" --include="*.py" . ; then
46+
echo "⚠️ Dangerous functions found!"
47+
exit 1
48+
fi
49+
50+
echo "✅ Basic checks passed"
51+
52+
- name: CodeQL Analysis
53+
uses: github/codeql-action/init@v3
54+
with:
55+
languages: python
56+
57+
- name: Run CodeQL
58+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)