Fix error message reported on non-local action setup (#2668)

* Fix error message reported on non-local action setup

* Remove tostring left from string builder
This commit is contained in:
Nikola Jokic
2023-06-29 11:33:46 +02:00
committed by GitHub
parent 5f1c6f4708
commit a2b7856c9c

View File

@@ -1127,8 +1127,16 @@ namespace GitHub.Runner.Worker
}
else
{
var fullPath = IOUtil.ResolvePath(actionEntryDirectory, "."); // resolve full path without access filesystem.
throw new InvalidOperationException($"Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '{fullPath}'. Did you forget to run actions/checkout before running your local action?");
var reference = repositoryReference.Name;
if (!string.IsNullOrEmpty(repositoryReference.Path))
{
reference = $"{reference}/{repositoryReference.Path}";
}
if (!string.IsNullOrEmpty(repositoryReference.Ref))
{
reference = $"{reference}@{repositoryReference.Ref}";
}
throw new InvalidOperationException($"Can't find 'action.yml', 'action.yaml' or 'Dockerfile' for action '{reference}'.");
}
}