In the section called Install a global tool, it says that the tools are installed at the following locations:
OS |
Path |
Linux/macOS |
$HOME/.dotnet/tools |
Windows |
%USERPROFILE%\.dotnet\tools |
Below that, it also says:
This location is added to the user's path when the SDK is first run,
so global tools can be invoked from any directory without specifying
the tool location.
However, it looks like from your output that you also just installed the .NET SDK so it hasn't had a chance to add those folders to the PATH
.
There are two ways of doing this that immediately come to mind:
Since you already know where the tools are installed, just use the absolute path to the tool you just installed: $HOME/.dotnet/tools/my-tool
Another way is to fix the PATH
before running the tool so that when you get to the step that installed the tool, it is already available. In your workflow, there are many ways of modifying the PATH
, but the easiest seems to be to modify the $GITHUB_PATH
file. So in a previous step, do the following inside run
run:
...
mkdir --parents $HOME/.dotnet/tools
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
After this is done, the next step, should be able to access the tool after installing it.