Skip to content

Commit c3c5e48

Browse files
authored
ci: periodically scan for vulnerabilities (#132)
1 parent 8602772 commit c3c5e48

File tree

4 files changed

+287
-196
lines changed

4 files changed

+287
-196
lines changed

.github/workflows/security.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
1-
# This workflow will run security checks against our project
2-
31
name: Security
42

53
on:
64
push:
75
branches: ["main"]
86
pull_request:
97
branches: ["main"]
8+
schedule:
9+
- cron: "0 0 * * 1" # every Monday at 00:00 UTC
1010

1111
jobs:
1212
osv-scanner:
13-
runs-on: ubuntu-latest
1413
if: "!startsWith(github.event.head_commit.message, 'bump:')"
14+
runs-on: ubuntu-latest
1515
container:
1616
image: ghcr.io/google/osv-scanner:v2.1.0@sha256:9a1ba57d2a1506c9e9d0dfbeaf46346507e829745b70d47d77e12c38e66de8d7
1717
steps:
1818
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1919
- name: Run OSV Scanner
2020
run: |
2121
/osv-scanner --format table -r .
22+
2223
semgrep:
24+
if: github.event_name != 'schedule' && !startsWith(github.event.head_commit.message, 'bump:')
2325
runs-on: ubuntu-latest
24-
if: "!startsWith(github.event.head_commit.message, 'bump:')"
2526
container:
2627
image: returntocorp/semgrep:1.128.1@sha256:144d315f7354c2b2c53021a76165a500f67252c47464be75e951b67050f54a9e
2728
steps:
2829
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2930
- name: Run Semgrep
3031
run: |
3132
semgrep scan --config auto
33+
3234
twyn:
35+
if: github.event_name != 'schedule' && !startsWith(github.event.head_commit.message, 'bump:')
3336
runs-on: ubuntu-latest
34-
if: "!startsWith(github.event.head_commit.message, 'bump:')"
3537
container:
3638
image: elementsinteractive/twyn:2.9.0@sha256:71dc5d45bc42756282dc7adf511e6c015c05b69ef28e2b5556cd155650c3519a
3739
steps:
3840
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3941
- name: Run twyn
4042
run: |
41-
twyn run -vv
43+
twyn run -vv

src/lightman_ai/core/sentry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
def configure_sentry() -> None:
99
"""Configure Sentry for error tracking."""
1010
try:
11-
import sentry_sdk
12-
from sentry_sdk.integrations.logging import LoggingIntegration
11+
import sentry_sdk # noqa: PLC0415
12+
from sentry_sdk.integrations.logging import LoggingIntegration # noqa: PLC0415
1313
except ImportError:
1414
logger.warning(
1515
"Could not initialize sentry, it is not installed! Add it by installing the project with `lightman-ai[sentry]`."

tests/eval/test_classifier.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from datetime import UTC, datetime
22
from unittest.mock import Mock, patch
33

4-
from lightman_ai.article.models import Article, SelectedArticle, SelectedArticlesList
5-
64
from eval.classifier import Classifier
75
from eval.constants import MISSED_ARTICLE_REASON, MISSED_ARTICLE_RELEVANCE_SCORE
6+
from lightman_ai.article.models import Article, SelectedArticle, SelectedArticlesList
87

98

109
class TestClassifier:

0 commit comments

Comments
 (0)