@@ -311,37 +311,37 @@ def build_call_graph_from_node(node: GitHubWorkflowNode, repo_path: str) -> None
311311 )
312312 external_node .model = create_third_party_action_model (external_node )
313313 job_node .add_callee (external_node )
314- else :
315- # Check the shell type configuration. We currently can support `bash`` and `sh`.
316- # By default `bash`` is used on non-Windows runners, which we support.
317- # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrunshell
318- # TODO: support Powershell for Windows runners, which is the default shell in GitHub Actions.
319- # Right now, the script with the default shell is passed to the parser, which will fail
320- # if the runner is Windows and Powershell is used. But there is no easy way to avoid passing
321- # the script because that means we need to accurately determine the runner's OS.
322- if step .get ("run" ) and ("shell" not in step or step ["shell" ] in {"bash" , "sh" }):
323- try :
324- name = "UNKNOWN"
325- node_id = None
326- if "id" in step :
327- node_id = step ["id" ]
328- if "name" in step :
329- name = step ["name" ]
330-
331- callee = create_bash_node (
332- name = name ,
333- node_id = node_id ,
334- node_type = BashScriptType .INLINE ,
335- source_path = node .source_path ,
336- ci_step_ast = step ,
337- repo_path = repo_path ,
338- caller = job_node ,
339- recursion_depth = 0 ,
340- )
341- except CallGraphError as error :
342- logger .debug (error )
343- continue
344- job_node .add_callee (callee )
314+
315+ # Check the shell type configuration. We currently can support `bash`` and `sh`.
316+ # By default `bash`` is used on non-Windows runners, which we support.
317+ # See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrunshell
318+ # TODO: support Powershell for Windows runners, which is the default shell in GitHub Actions.
319+ # Right now, the script with the default shell is passed to the parser, which will fail
320+ # if the runner is Windows and Powershell is used. But there is no easy way to avoid passing
321+ # the script because that means we need to accurately determine the runner's OS.
322+ elif step .get ("run" ) and ("shell" not in step or step ["shell" ] in {"bash" , "sh" }):
323+ try :
324+ name = "UNKNOWN"
325+ node_id = None
326+ if "id" in step :
327+ node_id = step ["id" ]
328+ if "name" in step :
329+ name = step ["name" ]
330+
331+ callee = create_bash_node (
332+ name = name ,
333+ node_id = node_id ,
334+ node_type = BashScriptType .INLINE ,
335+ source_path = node .source_path ,
336+ ci_step_ast = step ,
337+ repo_path = repo_path ,
338+ caller = job_node ,
339+ recursion_depth = 0 ,
340+ )
341+ except CallGraphError as error :
342+ logger .debug (error )
343+ continue
344+ job_node .add_callee (callee )
345345
346346 elif is_reusable_workflow_call_job (job ):
347347 workflow_call_job_with_id = Identified [ReusableWorkflowCallJob ](job_name , job )
0 commit comments