File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/zenml/integrations/github/code_repositories Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,29 @@ def download_files(
187
187
directory = local_path ,
188
188
repo_sub_directory = content .path ,
189
189
)
190
+ # For symlinks, content.type is initially wrongly set to "file",
191
+ # which is why we need to read it from the raw data instead.
192
+ elif content .raw_data ["type" ] == "symlink" :
193
+ try :
194
+ os .symlink (src = content .raw_data ["target" ], dst = local_path )
195
+ except Exception as e :
196
+ logger .error (
197
+ "Failed to create symlink `%s` (%s): %s" ,
198
+ content .path ,
199
+ content .html_url ,
200
+ e ,
201
+ )
190
202
else :
191
203
try :
192
204
with open (local_path , "wb" ) as f :
193
205
f .write (content .decoded_content )
194
206
except (GithubException , IOError , AssertionError ) as e :
195
- logger .error ("Error processing %s: %s" , content .path , e )
207
+ logger .error (
208
+ "Error processing `%s` (%s): %s" ,
209
+ content .path ,
210
+ content .html_url ,
211
+ e ,
212
+ )
196
213
197
214
def get_local_context (self , path : str ) -> Optional [LocalRepositoryContext ]:
198
215
"""Gets the local repository context.
You can’t perform that action at this time.
0 commit comments