Add the ability to setup a caching git-lfs proxy server

This commit is contained in:
Matthew Endsley 2022-10-11 16:52:31 -07:00
parent 1f9a0c22da
commit 5262024a96
6 changed files with 2391 additions and 2354 deletions

View file

@ -182,6 +182,19 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
)
core.endGroup()
// LFS URL
if (settings.lfs && settings.lfsurl) {
core.startGroup('Setting LFS URL')
await git
.config('lfs.url', settings.lfsurl, false, false)
.catch(error => {
core.info(
`Failed to initialize safe directory with error: ${error}`
)
})
core.endGroup()
}
// LFS fetch
// Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
// Explicit lfs fetch will fetch lfs objects in parallel.

View file

@ -39,6 +39,11 @@ export interface IGitSourceSettings {
*/
lfs: boolean
/**
* The fetch URL to use for LFS objects
*/
lfsurl: string
/**
* Indicates whether to checkout submodules
*/

View file

@ -91,6 +91,7 @@ export async function getInputs(): Promise<IGitSourceSettings> {
// LFS
result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE'
result.lfsurl = (core.getInput('lfs-url') || '')
core.debug(`lfs = ${result.lfs}`)
// Submodules