Exclude path from clean

This commit is contained in:
Gregory Bonaert 2025-04-09 17:24:36 +02:00
parent 85e6279cec
commit 9a73efb9ba
6 changed files with 28 additions and 5 deletions

View file

@ -11,6 +11,7 @@ export async function prepareExistingDirectory(
repositoryPath: string,
repositoryUrl: string,
clean: boolean,
exclude_from_clean: string | undefined,
ref: string
): Promise<void> {
assert.ok(repositoryPath, 'Expected repositoryPath to be defined')
@ -90,7 +91,7 @@ export async function prepareExistingDirectory(
// Clean
if (clean) {
core.startGroup('Cleaning the repository')
if (!(await git.tryClean())) {
if (!(await git.tryClean(exclude_from_clean))) {
core.debug(
`The clean command failed. This might be caused by: 1) path too long, 2) permission issue, or 3) file in use. For further investigation, manually run 'git clean -ffdx' on the directory '${repositoryPath}'.`
)