I cannot found related REST API to add submodules.
We can configure the submodules setting in the Checkout step of your pipeline if you want to download files from submodules.
Sample code:
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: boolean # whether to fetch clean each time
fetchDepth: number # the depth of commits to ask Git to fetch
lfs: boolean # whether to download Git-LFS files
submodules: true | recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
path: string # path to check out source code, relative to the agent's build directory (e.g. \_work\1)
persistCredentials: boolean # set to 'true' to leave the OAuth token in the Git config after the initial fetch
Or we can use git commandgit submodule add {url} to Checkout submodules
Update1
We can install PowerShell module posh-git, then we could use git cmd in the power shell. You can refer to the doc posh-git and Setting up Git in PowerShell
I cannot found related REST API to add submodules.
We can configure the submodules setting in the Checkout step of your pipeline if you want to download files from submodules. Sample code:
Or we can use git command
git submodule add {url}
to Checkout submodulesUpdate1
We can install PowerShell module posh-git, then we could use git cmd in the power shell. You can refer to the doc posh-git and Setting up Git in PowerShell