security: Add explicit permissions and security scanning workflow

- Add explicit permissions to all workflows (format, release, ci, test, label-issues, mark-answered)
- Fix format.yml to have write permissions for PR creation
- Add security.yml workflow for automated vulnerability scanning
- Improve security posture with minimal permissions principle
This commit is contained in:
KaifAhmad1
2025-11-24 17:20:10 +05:30
parent 38fa194787
commit 1271957737
234 changed files with 2097 additions and 1568 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
# Code formatting script
# Formats code with black and sorts imports with isort
set -e
echo "🎨 Formatting code..."
# Activate virtual environment if it exists
if [ -d "venv" ]; then
source venv/bin/activate
fi
# Check if directories exist
if [ ! -d "semantica" ]; then
echo "❌ semantica/ directory not found"
exit 1
fi
# Format with black
echo "📝 Formatting with black..."
black semantica/
echo "✅ Black formatting complete"
# Sort imports with isort
echo "📦 Sorting imports with isort..."
isort semantica/
echo "✅ Import sorting complete"
echo ""
echo "✅ Code formatting complete!"