File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515def process_notebooks (directory = "." ):
1616 """Find and process all notebook files in the repository"""
1717 notebook_files = []
18+ print (f"Searching for notebooks in directory: { directory } " )
1819 for root , dirs , files in os .walk (directory ):
20+ # Skip directories that should be excluded
1921 if '.git' in dirs :
2022 dirs .remove ('.git' ) # Skip git directory
2123 if '.github' in dirs :
2224 dirs .remove ('.github' ) # Skip GitHub directory
25+ if '.venv' in dirs :
26+ dirs .remove ('.venv' ) # Skip virtual environments
27+
2328 for file in files :
2429 if file .endswith ('.ipynb' ):
25- notebook_files .append (os .path .join (root , file ))
30+ notebook_path = os .path .join (root , file )
31+ print (f"Found notebook: { notebook_path } " )
32+ notebook_files .append (notebook_path )
2633
2734 print (f"Found { len (notebook_files )} notebooks to process" )
2835
@@ -148,4 +155,7 @@ def convert_notebook(filepath):
148155
149156if __name__ == "__main__" :
150157 print ("Rendering notebooks for GitHub compatibility..." )
151- process_notebooks ()
158+ # Get the repository root directory from environment variable if available
159+ repo_root = os .environ .get ('GITHUB_WORKSPACE' , '.' )
160+ print (f"Repository root: { repo_root } " )
161+ process_notebooks (repo_root )
You can’t perform that action at this time.
0 commit comments