Skip to content

Commit f98e22e

Browse files
committed
ci: security check for py-api client
1 parent bdbff66 commit f98e22e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Python-api QA (Security & Style)
2+
3+
# Trigger the workflow on every push
4+
on: [push]
5+
6+
jobs:
7+
quality-assurance:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.9'
17+
18+
- name: Install dependencies
19+
run: |
20+
# Upgrade pip and install security/linting tools
21+
python -m pip install --upgrade pip
22+
pip install bandit detect-secrets flake8 flake8-json ruff
23+
24+
- name: Run Bandit (Security Scan)
25+
# Scan the mergin folder for vulnerabilities, excluding the test directory
26+
run: bandit -r ./mergin/ -ll --exclude ./mergin/test
27+
28+
- name: Run Detect Secrets
29+
# Scan the plugin directory for hardcoded secrets/credentials
30+
run: detect-secrets scan ./mergin/ --all-files
31+
32+
- name: Run Ruff (Linting)
33+
# Excluding mergin/test
34+
run: ruff check ./mergin/ --line-length 120 --exclude mergin/test
35+
36+
- name: Run Flake8 (Style Check)
37+
# Style enforcement using MerginMaps standards
38+
# Ignoring E501 (line length) and W503 (operator line breaks)
39+
run: |
40+
flake8 ./mergin/ --max-line-length=120 --ignore=E501,W503 --exclude=test

0 commit comments

Comments
 (0)