From a2b7856c9c218da0211b47061226a0e8f85ece85 Mon Sep 17 00:00:00 2001 From: Nikola Jokic Date: Thu, 29 Jun 2023 11:33:46 +0200 Subject: [PATCH] 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 --- src/Runner.Worker/ActionManager.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Runner.Worker/ActionManager.cs b/src/Runner.Worker/ActionManager.cs index 04112b533be..b11b6994785 100644 --- a/src/Runner.Worker/ActionManager.cs +++ b/src/Runner.Worker/ActionManager.cs @@ -1127,8 +1127,16 @@ private ActionSetupInfo PrepareRepositoryActionAsync(IExecutionContext execution } 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}'."); } }