mirror of
https://github.com/actions/checkout.git
synced 2025-04-20 17:46:45 +00:00
Add ability to configure core.longpaths
This commit is contained in:
parent
afee87ec84
commit
925b9fdcfa
6 changed files with 38 additions and 0 deletions
|
@ -174,6 +174,18 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
}
|
||||
core.endGroup()
|
||||
|
||||
if (settings.longpaths) {
|
||||
core.startGroup('Setting core.longpaths to true')
|
||||
await git
|
||||
.config('core.longpaths', 'true', false, false)
|
||||
.catch(error => {
|
||||
core.warning(
|
||||
`Failed to set core.longpaths with error: ${error}`
|
||||
)
|
||||
})
|
||||
core.endGroup()
|
||||
}
|
||||
|
||||
// Checkout info
|
||||
core.startGroup('Determining the checkout info')
|
||||
const checkoutInfo = await refHelper.getCheckoutInfo(
|
||||
|
|
|
@ -98,4 +98,9 @@ export interface IGitSourceSettings {
|
|||
* User override on the GitHub Server/Host URL that hosts the repository to be cloned
|
||||
*/
|
||||
githubServerUrl: string | undefined
|
||||
|
||||
/**
|
||||
* Indicates wheter to set core.longpaths in the git config
|
||||
*/
|
||||
longpaths: boolean
|
||||
}
|
||||
|
|
|
@ -132,5 +132,8 @@ export async function getInputs(): Promise<IGitSourceSettings> {
|
|||
result.githubServerUrl = core.getInput('github-server-url')
|
||||
core.debug(`GitHub Host URL = ${result.githubServerUrl}`)
|
||||
|
||||
// config
|
||||
result.longpaths = core.getInput('long-paths').toUpperCase() == 'TRUE'
|
||||
|
||||
return result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue