mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 17:12:03 +03:00
Unset the lfs.url if one isn't specified
This commit is contained in:
parent
f72e8cbe70
commit
c5ef344f79
2 changed files with 37 additions and 18 deletions
|
@ -197,10 +197,11 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
core.endGroup()
|
||||
|
||||
// LFS URL
|
||||
if (settings.lfs && settings.lfsurl) {
|
||||
if (settings.lfs) {
|
||||
if (settings.lfsurl) {
|
||||
core.startGroup('Setting LFS URL')
|
||||
let remote = new URL(settings.lfsurl)
|
||||
remote.password = core.getInput('token')
|
||||
let remote = new URL(settings.lfsurl)
|
||||
remote.password = core.getInput('token')
|
||||
await git
|
||||
.config('lfs.url', remote.href, false, false)
|
||||
.catch(error => {
|
||||
|
@ -223,6 +224,15 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
})
|
||||
core.endGroup()
|
||||
}
|
||||
} else {
|
||||
await git
|
||||
.tryConfigUnset('lfs.url', false)
|
||||
.catch(error => {
|
||||
core.info(
|
||||
`Failed to remove lfs.url with error: ${error}`
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// LFS fetch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue