Skip to content

Commit

Permalink
Fix error message reported on non-local action setup (actions#2668)
Browse files Browse the repository at this point in the history
* Fix error message reported on non-local action setup

* Remove tostring left from string builder
  • Loading branch information
nikola-jokic authored Jun 29, 2023
1 parent 5f1c6f4 commit a2b7856
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Runner.Worker/ActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}'.");
}
}

Expand Down

0 comments on commit a2b7856

Please sign in to comment.