Add sparse checkout support

This commit is contained in:
Jonne Laagland Winder 2022-01-31 23:14:53 +00:00
parent 230611dbd0
commit ad6eac3f6b
11 changed files with 128 additions and 0 deletions

View file

@ -163,6 +163,13 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
core.endGroup()
}
// Sparse checkout
if (settings.sparse) {
core.startGroup('Sparse checkout')
await git.sparseCheckout(settings.sparseCone, settings.sparse)
core.endGroup()
}
// Checkout
core.startGroup('Checking out the ref')
await git.checkout(checkoutInfo.ref, checkoutInfo.startPoint)