File tree Expand file tree Collapse file tree 4 files changed +287
-196
lines changed
Expand file tree Collapse file tree 4 files changed +287
-196
lines changed Original file line number Diff line number Diff line change 1- # This workflow will run security checks against our project
2-
31name : Security
42
53on :
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
1111jobs :
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
Original file line number Diff line number Diff line change 88def 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]`."
Original file line number Diff line number Diff line change 11from datetime import UTC , datetime
22from unittest .mock import Mock , patch
33
4- from lightman_ai .article .models import Article , SelectedArticle , SelectedArticlesList
5-
64from eval .classifier import Classifier
75from eval .constants import MISSED_ARTICLE_REASON , MISSED_ARTICLE_RELEVANCE_SCORE
6+ from lightman_ai .article .models import Article , SelectedArticle , SelectedArticlesList
87
98
109class TestClassifier :
You can’t perform that action at this time.
0 commit comments