$schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json
type: command

tags:
    Preview: ""

version: 0.0.77
name: llm_rag_git_clone
display_name: LLM - Clone Git Repo
is_deterministic: true

description: |
  Clones a git repository to output_data path

inputs:
  git_repository:
    type: string
    description: "The URL of the git repository"
  branch_name:
    type: string
    optional: true
    description: "The branch name to pull from the git repository, default picked by git if not specified."
  authentication_key_prefix:
    type: string
    optional: true
    description: "<PREFIX>-USER and <PREFIX>-PASS are the expected names of two Secrets in the Workspace Key Vault which will be used for authenticated when pulling the given git repo."
  git_connection_id:
    type: string
    optional: true
    description: "The connection id of the git provider to use."

outputs:
  output_data:
    type: uri_folder
    description: "Uri folder containing all files from the git repo"
    mode: upload

environment: azureml:llm-rag-embeddings@latest
code: '../src/'

command: >-
  python -m azureml.rag.tasks.git_clone
  --git-repository ${{inputs.git_repository}}
  $[[--branch-name ${{inputs.branch_name}}]]
  $[[--authentication-key-prefix ${{inputs.authentication_key_prefix}}]]
  $[[--git-connection-id ${{inputs.git_connection_id}}]]
  --output-data '${{outputs.output_data}}'
