Fix exclusions in cache-dependency-glob (#546)

Fixes: #537
This commit is contained in:
Kevin Stillhammer
2025-09-01 16:12:49 +02:00
committed by GitHub
parent 26cf676705
commit 1b46e13ec8
4 changed files with 105 additions and 30 deletions

View File

@ -116,16 +116,15 @@ function expandTilde(input: string): string {
}
function resolveRelativePath(inputPath: string): string {
if (path.isAbsolute(inputPath)) {
return inputPath;
}
let absolutePath = inputPath;
if (absolutePath.startsWith("./")) {
absolutePath = absolutePath.substring(2);
}
absolutePath = `${workingDirectory}${path.sep}${absolutePath}`;
core.debug(`Resolving relative path ${inputPath} to ${absolutePath}`);
return absolutePath;
const hasNegation = inputPath.startsWith("!");
const pathWithoutNegation = hasNegation ? inputPath.substring(1) : inputPath;
const resolvedPath = path.resolve(workingDirectory, pathWithoutNegation);
core.debug(
`Resolving relative path ${inputPath} to ${hasNegation ? "!" : ""}${resolvedPath}`,
);
return hasNegation ? `!${resolvedPath}` : resolvedPath;
}
function getManifestFile(): string | undefined {