Fix logic for trimming manifestfile path

This commit is contained in:
Ethan Chiu
2020-07-08 14:43:03 -04:00
parent b3eea21e4f
commit af9202bd8d

View File

@@ -61,7 +61,7 @@ namespace GitHub.Runner.Worker
// we can just remove the # of characters from the fileName according to the length of the basePath // we can just remove the # of characters from the fileName according to the length of the basePath
string basePath = HostContext.GetDirectory(WellKnownDirectory.Actions); string basePath = HostContext.GetDirectory(WellKnownDirectory.Actions);
string fileRelativePath = manifestFile; string fileRelativePath = manifestFile;
if (manifestFile.Length > basePath.Length + 1) if (manifestFile.Contains(basePath))
{ {
fileRelativePath = manifestFile.Remove(0, basePath.Length + 1); fileRelativePath = manifestFile.Remove(0, basePath.Length + 1);
} }