Skip to content

Commit 03059ae

Browse files
committed
fix: update secrets baseline
1 parent 36b4dec commit 03059ae

3 files changed

Lines changed: 48 additions & 27 deletions

File tree

.github/workflows/ci.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: CI Pipeline
22

3+
# Триггеры для CI
34
on:
45
push:
56
branches: [main]
@@ -14,20 +15,24 @@ jobs:
1415
python-version: [3.12]
1516

1617
steps:
18+
# 1️⃣ Checkout проекта
1719
- name: Checkout repository
1820
uses: actions/checkout@v4
1921

22+
# 2️⃣ Настройка Python и кеширование pip
2023
- name: Set up Python
2124
uses: actions/setup-python@v4
2225
with:
2326
python-version: ${{ matrix.python-version }}
2427
cache: "pip"
2528

29+
# 3️⃣ Установка UV и зависимостей
2630
- name: Install UV
2731
run: |
2832
python -m pip install --upgrade pip
2933
pip install uv
3034
35+
# 4️⃣ Кешируем virtualenv UV для ускорения повторных запусков
3136
- name: Cache UV virtualenv
3237
uses: actions/cache@v4
3338
with:
@@ -38,9 +43,11 @@ jobs:
3843
restore-keys: |
3944
${{ runner.os }}-uv-
4045
46+
# 5️⃣ Синхронизация зависимостей проекта через UV
4147
- name: Sync dependencies
4248
run: uv sync
4349

50+
# 6️⃣ Pre-commit checks (форматирование, линтеры и проверки безопасности)
4451
- name: Run Pre-commit checks
4552
uses: pre-commit/action@v3.0.0
4653
with:
@@ -49,36 +56,42 @@ jobs:
4956
- name: Clear pre-commit cache
5057
run: pre-commit clean
5158

59+
# 7️⃣ Статическая проверка типизации
5260
- name: Run Mypy
5361
run: uv run mypy src/
5462

63+
# 8️⃣ Линтер
5564
- name: Run Ruff
5665
run: uv run ruff check src/
5766

67+
# 9️⃣ Тесты проекта
5868
- name: Run Tests
5969
env:
6070
ENV: test
6171
MAIL_USERNAME: test@example.com
6272
MAIL_PASSWORD: testpass
6373
run: uv run pytest -v --disable-warnings --maxfail=1
64-
65-
# - name: Install security tools
66-
# run: |
67-
# python -m pip install --upgrade pip
68-
# pip install pip-audit bandit safety
6974

75+
# 🔒 10️⃣ Аудит безопасности зависимостей
7076
- name: Dependency security audit (pip-audit)
71-
run: |
72-
pip-audit --format=human
77+
run: uv run pip-audit --format=human
7378

7479
- name: Static security scan (Bandit)
75-
run: |
76-
bandit -r src -ll
80+
run: uv run bandit -r src -ll
7781

78-
- name: Safety check (optional)
79-
run: |
80-
safety check
82+
- name: Safety scan
83+
run: uv run safety scan
84+
85+
# 11️⃣ CodeQL security scanning
86+
- name: Initialize CodeQL
87+
uses: github/codeql-action/init@v3
88+
with:
89+
languages: python
90+
91+
- name: Perform CodeQL Analysis
92+
uses: github/codeql-action/analyze@v3
8193

94+
# 12️⃣ Сохраняем кэш pytest при падении тестов
8295
- name: Upload pytest cache
8396
if: failure()
8497
uses: actions/upload-artifact@v4

.github/workflows/codeql-analysis.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ on:
66
pull_request:
77
branches: [ main ]
88
schedule:
9-
- cron: "0 3 * * 0"
9+
- cron: '0 0 * * 0' # опционально, раз в неделю
1010

1111
jobs:
12-
analyze:
13-
name: Analyze (CodeQL)
12+
codeql:
13+
name: Analyze
1414
runs-on: ubuntu-latest
1515
permissions:
1616
actions: read
1717
contents: read
1818
security-events: write
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [ 'python' ] # укажи нужные языки
1923
steps:
20-
- name: Checkout repository
21-
uses: actions/checkout@v4
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
2226

23-
- name: Initialize CodeQL
24-
uses: github/codeql-action/init@v2
25-
with:
26-
languages: python
27+
- name: Initialize CodeQL
28+
uses: github/codeql-action/init@v3
29+
with:
30+
languages: ${{ matrix.language }}
2731

28-
- name: Autobuild (if needed)
29-
uses: github/codeql-action/autobuild@v2
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v3
3034

31-
- name: Run CodeQL analysis
32-
uses: github/codeql-action/analyze@v2
35+
- name: Perform CodeQL Analysis
36+
uses: github/codeql-action/analyze@v3

.secrets.baseline

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@
9090
{
9191
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
9292
},
93+
{
94+
"path": "detect_secrets.filters.common.is_baseline_file",
95+
"filename": ".secrets.baseline"
96+
},
9397
{
9498
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
9599
"min_level": 2
@@ -152,7 +156,7 @@
152156
"filename": ".github\\workflows\\ci.yml",
153157
"hashed_secret": "206c80413b9a96c1312cc346b7d2517b84463edd",
154158
"is_verified": false,
155-
"line_number": 62
159+
"line_number": 72
156160
}
157161
],
158162
"README.md": [
@@ -228,5 +232,5 @@
228232
}
229233
]
230234
},
231-
"generated_at": "2025-12-10T18:38:20Z"
235+
"generated_at": "2025-12-10T19:35:10Z"
232236
}

0 commit comments

Comments
 (0)