Update issue templates #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatic Security Check for Malicious Code | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
bandit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install Bandit | |
run: pip install bandit | |
- name: Run Bandit | |
id: bandit | |
run: | | |
bandit -r . -f json > bandit_report.json || true | |
if grep -q '"issue"' bandit_report.json; then | |
echo "Malicious code detected!" | |
exit 1 | |
else | |
echo "No malicious code detected." | |
fi | |
- name: Display check result | |
run: | | |
if [ $? -eq 0 ]; then | |
echo "✅ No malicious code detected." | |
else | |
echo "❌ Malicious code detected." | |
fi |