Soenneker.GitHub.Repositories.Readmes 4.0.1030

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.GitHub.Repositories.Readmes --version 4.0.1030
                    
NuGet\Install-Package Soenneker.GitHub.Repositories.Readmes -Version 4.0.1030
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.GitHub.Repositories.Readmes" Version="4.0.1030" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.GitHub.Repositories.Readmes" Version="4.0.1030" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.GitHub.Repositories.Readmes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.GitHub.Repositories.Readmes --version 4.0.1030
                    
#r "nuget: Soenneker.GitHub.Repositories.Readmes, 4.0.1030"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.GitHub.Repositories.Readmes@4.0.1030
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.GitHub.Repositories.Readmes&version=4.0.1030
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.GitHub.Repositories.Readmes&version=4.0.1030
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.GitHub.Repositories.Readmes

Create or replace a repository's README.md with a GitHub commit on the branch you choose.

Installation

dotnet add package Soenneker.GitHub.Repositories.Readmes

Configuration

{
  "GH": {
    "Token": "github-token"
  }
}

The token must have repository contents write access.

Registration

services.AddGitHubRepositoriesReadmesUtilAsSingleton();

Use AddGitHubRepositoriesReadmesUtilAsScoped() for a scoped consumer.

Usage

public sealed class RepositoryReadmeService
{
    private readonly IGitHubRepositoriesReadmesUtil _readmes;

    public RepositoryReadmeService(IGitHubRepositoriesReadmesUtil readmes)
    {
        _readmes = readmes;
    }

    public ValueTask Publish(
        string markdown,
        CancellationToken cancellationToken = default)
    {
        return _readmes.Upsert(
            owner: "soenneker",
            name: "example-repository",
            commitMessage: "Update README",
            content: markdown,
            branch: "main",
            cancellationToken);
    }
}
  • Create fails when README.md already exists.
  • Update reads the file's current SHA from the requested branch, then replaces its contents.
  • Upsert updates the file when present and creates it only when GitHub reports it missing.

Each successful call creates a commit. The supplied content replaces the entire file; it is not merged with the existing Markdown. The branch must already exist.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.GitHub.Repositories.Readmes:

Package Downloads
Soenneker.GitHub.Repositories.Suite

Registers commonly used Soenneker GitHub repository services through one package

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1032 0 9/3/2026
4.0.1031 37 9/3/2026
4.0.1030 45 9/3/2026
4.0.1029 118 9/1/2026
4.0.1028 72 9/1/2026
4.0.1027 50 9/1/2026
4.0.1026 75 8/31/2026
4.0.1025 100 8/31/2026
4.0.1024 74 8/31/2026
4.0.1023 149 8/31/2026
4.0.1022 80 8/31/2026
4.0.1021 76 8/31/2026
4.0.1020 147 8/30/2026
4.0.1019 79 8/30/2026
4.0.1018 135 8/30/2026
4.0.1017 89 8/30/2026
4.0.1016 75 8/30/2026
4.0.1015 162 8/29/2026
4.0.1014 115 8/29/2026
4.0.1013 149 8/28/2026
Loading failed

Update dependency Soenneker.GitHub.ClientUtil to 4.0.631 (#1568)