The DotNet Add action can be used to add a reference to a .Net project file.
The command starts with a compatibility check to ensure the package is compatible with the frameworks in the project. If the check passes, a <PackageReference> element is added to the project file and dotnet restore is run.
DotNet
...
Add
Name
A friendly name for this action (will be displayed in the actions workflow area).
...
Package to project
Project Path
Path The path to project file or folder to modify. If a folder is specified, the folder will be searched for a file that has a file extension that ends in `proj`. Defaults "proj". This defaults to the workspace folder.
Working Folder
Optional working folder for running the executable. Defaults to the project folderpath.
Target Framework
Adds references only when targeting a specific framework.
...