mirror of
https://github.com/actions/checkout.git
synced 2025-04-20 17:46:45 +00:00
Add clean-exclude input
This allows clients to ignore specific paths from the clean phase of the checkout.
This commit is contained in:
parent
925b9fdcfa
commit
0f6c54dea3
8 changed files with 38 additions and 9 deletions
|
@ -42,7 +42,7 @@ export interface IGitCommandManager {
|
|||
submoduleSync(recursive: boolean): Promise<void>
|
||||
submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void>
|
||||
tagExists(pattern: string): Promise<boolean>
|
||||
tryClean(): Promise<boolean>
|
||||
tryClean(exclude: string[]): Promise<boolean>
|
||||
tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean>
|
||||
tryDisableAutomaticGarbageCollection(): Promise<boolean>
|
||||
tryGetFetchUrl(): Promise<string>
|
||||
|
@ -331,8 +331,14 @@ class GitCommandManager {
|
|||
return !!output.stdout.trim()
|
||||
}
|
||||
|
||||
async tryClean(): Promise<boolean> {
|
||||
const output = await this.execGit(['clean', '-ffdx'], true)
|
||||
async tryClean(exclude: string[]): Promise<boolean> {
|
||||
var cleanArgs: string[] = []
|
||||
for (const pattern of exclude) {
|
||||
cleanArgs.push('-e')
|
||||
cleanArgs.push(pattern)
|
||||
}
|
||||
|
||||
const output = await this.execGit(['clean', '-ffdx', ...cleanArgs], true)
|
||||
return output.exitCode === 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue