Automagically update NuGet packages in .NET projects.
Because .Net devs are bad at applying NuGet package updates.
NuKeeper will compare the NuGet packages used in your solution to the latest versions available on Nuget.org, and make PRs containing updates.
Written in .Net core, using http APIs and command-line tools.
Will PR a single repository. Point it at the https url of a github repository, like this:
syntax:
C:\Code\NuKeeper\NuKeeper>dotnet run mode=repository t=<GitToken> github_repository_uri=<RepoUrl>
Will discover repositories in that organisation and update them.
C:\Code\NuKeeper\NuKeeper>dotnet run mode=organisation t=<GitToken> github_api_endpoint=https://api.github.com/ github_organisation_name=<OrgName>
| Name | Required | Overridable via CLI? |
|---|---|---|
| NuKeeper_github_token | Yes | Yes (t) |
- NuKeeper_github_token You will need to create a github personal access token to authorise access to your github server in order to raise PRs. Be sure to check the "repo" scope when creating the token. If you have just created this environment variabled, remember to restart your terminal and IDE before proceeding.
| Name | Required | Overridable via CLI? |
|---|---|---|
| github_api_endpoint | Yes | Yes (api) |
| max_pull_requests_per_repository | Yes | Yes (maxpr) |
- github_api_endpoint This is the api endpoint for the github instance you're targetting. Defaulted to
https://api.github.com. If you are using an internal github server and not the public one, you must set it to the api url for your github server. The value will be e.g.https://github.mycompany.com/api/v3. This applies to all modes. - max_pull_requests_per_repository The maximum number of pull requests to raise on any repository. The default value is 3.
| Name | Required |
|---|---|
| mode (m) | Yes |
| t | Yes |
| github_repository_uri (repo) | Depends on mode |
| github_organisation_name (org) | Depends on mode |
| api | Yes (in config.json) |
| maxpr | Yes (in config.json) |
- mode One of
repositoryororganisation. Inorganisationmode, all the repositories in that organisation will be processed. - t Overrides
NuKeeper_github_tokenin environment variables. - github_repository_uri The repository to scan. Required in
repositorymode, not usedorganisationmode. Aliased torepo. - github_organisation_name the organisation to scan. Required in
organisationmode, not usedrepositorymode. Aliased toorg. - api Overrides
github_api_endpointinconfig.json. Must be a fully qualified URL. - maxpr Overrides
max_pull_requests_per_repositoryinconfig.json.
If the project is a library that itself produces a NuGet package, it is usually best not to update it aggressively without cause.
e.g. if MyFancyLib depends upon Newtonsoft.Json version 9.0.1 then an application that depends upon MyFancyLib can use Newtonsoft.Json version 9.0.1 or a later version. Updating the reference in MyFancyLib to Newtonsoft.Json version 10.0.3 takes away some flexibility in the application using MyFancyLib.
It might even cause problems.
In an end-product deployable application, aggressive updating of packages is a better tactic.
This is an application of Postel's Law: Packages should be liberal in the range of package versions that they can accept, and applications should be strict about using up to date packages when they run.
It is similar to this rule of preferring to use a parameter of a base type or interface as it allows wider use.
You will need command line versions of git and dotnet installed.
It currently only runs on windows due to using cmd to invoke command-line processes for git and dotnet.
For projects using packages.config, NuGet.exe no longer runs install.ps1 and uninstall.ps1 scripts from command line.
Those are still executed from Visual Studio, resulting in different behaviour for packages relying on this functionality.
An example of this is StyleCop.Analyzers which will not update the <Analyzers> node in the project file.
Inspired by Greenkeeper.