File tree Expand file tree Collapse file tree 6 files changed +53
-16
lines changed Expand file tree Collapse file tree 6 files changed +53
-16
lines changed Original file line number Diff line number Diff line change 44 pull_request :
55 types : [opened, synchronize]
66 paths :
7- - ' skills/ **/*.ipynb'
7+ - ' **/*.ipynb'
88 - ' **.py'
99 - ' **.md'
1010
Original file line number Diff line number Diff line change 44 pull_request :
55 types : [opened, synchronize]
66 paths :
7- - ' skills/ **/*.ipynb'
7+ - ' **/*.ipynb'
88 - ' pyproject.toml'
99 - ' uv.lock'
1010 - ' scripts/**/*.py'
Original file line number Diff line number Diff line change 2727 pip install jupyter nbconvert
2828 mkdir -p temp_md
2929
30- for nb in skills/**/*.ipynb ; do
30+ for nb in $(find . -name "*.ipynb" -not -path "*/.*") ; do
3131 echo "Converting: $nb"
3232 jupyter nbconvert --to markdown "$nb" \
3333 --output-dir=temp_md \
Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ name: Notebook Quality Check
33on :
44 pull_request :
55 paths :
6- - ' skills/ **/*.ipynb'
6+ - ' **/*.ipynb'
77 - ' pyproject.toml'
88 - ' uv.lock'
99 push :
1010 branches : [main]
1111 paths :
12- - ' skills/ **/*.ipynb'
12+ - ' **/*.ipynb'
1313
1414permissions :
1515 contents : read
3737
3838 - name : Lint notebooks with Ruff
3939 run : |
40- uv run ruff check skills/ **/*.ipynb --show-fixes || true
41- uv run ruff format skills/ **/*.ipynb --check || true
40+ uv run ruff check **/*.ipynb --show-fixes || true
41+ uv run ruff format **/*.ipynb --check || true
4242
4343 - name : Validate notebook structure
4444 run : |
5454 ANTHROPIC_API_KEY : ${{ secrets.ANTHROPIC_API_KEY }}
5555 run : |
5656 mkdir -p test_outputs
57- for notebook in skills/*/guide .ipynb; do
57+ for notebook in $(find . -name "* .ipynb" -not -path "*/.*" -not -path "*/test_outputs/*") ; do
5858 echo "📓 Testing: $notebook"
59- output_name=$(basename $(dirname "$notebook") )
59+ output_name=$(echo "$notebook" | sed 's|/|_|g' | sed 's|\.|_|g' )
6060 # Use nbconvert to execute notebooks and save outputs
6161 uv run jupyter nbconvert --to notebook \
6262 --execute "$notebook" \
7575 github.event.pull_request.author_association != 'OWNER'
7676 run : |
7777 echo "🔒 Running in mock mode for external contributor"
78-
79- for notebook in skills/*/guide .ipynb; do
78+
79+ for notebook in $(find . -name "* .ipynb" -not -path "*/.*") ; do
8080 echo "📓 Validating structure: $notebook"
8181 uv run python -m nbformat.validator "$notebook"
8282 done
Original file line number Diff line number Diff line change 1+ name : SAST Security Monitor
2+
3+ on :
4+ pull_request :
5+
6+ permissions :
7+ contents : read
8+ pull-requests : write
9+
10+ jobs :
11+ security-scan :
12+ runs-on : ubuntu-latest
13+ continue-on-error : true # Never fail the build
14+ steps :
15+ - uses : actions/checkout@v4
16+ with :
17+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
18+ # fetch-depth: 2 is required to get the previous commit for diff analysis
19+ # The SAST tool needs git history to review changes between commits
20+ fetch-depth : 2
21+
22+ - uses : anthropics/sast@main
23+ with :
24+ mode : monitor
25+ comment-pr : true
26+ upload-results : true
27+ claude-api-key : ${{ secrets.ANTHROPIC_API_KEY }}
Original file line number Diff line number Diff line change @@ -32,20 +32,30 @@ def validate_notebook(path: Path) -> list:
3232def main ():
3333 """Check all notebooks."""
3434 has_issues = False
35-
36- for notebook in Path ('skills' ).glob ('**/*.ipynb' ):
35+
36+ # Find all notebooks in the repository
37+ notebooks = list (Path ('.' ).glob ('**/*.ipynb' ))
38+ # Exclude hidden directories and common build directories
39+ notebooks = [nb for nb in notebooks if not any (part .startswith ('.' ) for part in nb .parts )]
40+ notebooks = [nb for nb in notebooks if 'test_outputs' not in nb .parts ]
41+
42+ if not notebooks :
43+ print ("⚠️ No notebooks found to validate" )
44+ sys .exit (0 )
45+
46+ for notebook in notebooks :
3747 issues = validate_notebook (notebook )
3848 if issues :
3949 has_issues = True
4050 print (f"\n ❌ { notebook } :" )
4151 for issue in issues :
4252 print (f" - { issue } " )
43-
53+
4454 if not has_issues :
45- print ("✅ All notebooks validated successfully" )
55+ print (f "✅ All { len ( notebooks ) } notebooks validated successfully" )
4656 else :
4757 print ("\n ⚠️ Found issues that should be fixed in a separate PR" )
48-
58+
4959 # For POC, return 0 even with issues to show detection without blocking
5060 sys .exit (0 )
5161
You can’t perform that action at this time.
0 commit comments