Soenneker.GitHub.FileStore 11.0.861

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.GitHub.FileStore --version 11.0.861
                    
NuGet\Install-Package Soenneker.GitHub.FileStore -Version 11.0.861
                    
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.FileStore" Version="11.0.861" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.GitHub.FileStore" Version="11.0.861" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.GitHub.FileStore" />
                    
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.FileStore --version 11.0.861
                    
#r "nuget: Soenneker.GitHub.FileStore, 11.0.861"
                    
#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.FileStore@11.0.861
                    
#: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.FileStore&version=11.0.861
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.GitHub.FileStore&version=11.0.861
                    
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

Soenneker.GitHub.FileStore

Reads, writes, copies, moves, lists, and deletes repository files through GitHub's Contents API.

Installation

dotnet add package Soenneker.GitHub.FileStore

Configure and register

{
  "GH": {
    "Token": "your-github-token"
  }
}
using Soenneker.GitHub.FileStore.Registrars;

builder.Services.AddGitHubFileStoreAsSingleton();

Use a token with Contents read permission for Get, Read, List, and Exists. Writes and deletes require Contents write permission. Keep the token in secret storage.

Read and write files

string content = await store.Read(
    "example-org", "example-repository", "README.md", cancellationToken);

FileCommit? commit = await store.Write(
    owner: "example-org",
    repo: "example-repository",
    path: "docs/example.txt",
    content: "Hello from the Contents API",
    message: "Add example document",
    branch: "main",
    cancellationToken: cancellationToken);

Write and WriteBytes create a file when it does not exist and use its current SHA when updating it. The lookup is performed on the requested branch, so non-default branch updates do not reuse a SHA from main. Supplying both authorName and authorEmail sets the commit author; supplying only one leaves the author unset.

Copy, move, and directory operations

await store.Copy(
    "example-org", "example-repository",
    "docs/source.txt", "archive/source.txt",
    branch: "release",
    cancellationToken: cancellationToken);

IReadOnlyList<FileCommit> deleted = await store.DeleteDirectory(
    "example-org", "example-repository", "old-docs",
    branch: "release",
    cancellationToken: cancellationToken);

Copy and move read from the same branch they write to. A move is two commits—copy, then delete—so a failed delete can leave both paths and throws for the caller to handle. WriteDirectory and recursive deletion process files as separate commits and continue past individual file failures; their returned lists contain only successful commits.

Delete, DeleteDirectory, and DeleteRepositoryContents are destructive. They retrieve branch-specific SHAs immediately before deletion, but concurrent changes can still cause GitHub to reject a stale SHA.

Exists() returns false only for a not-found response. Authentication, permission, rate-limit, and transport failures propagate instead of being reported as a missing file.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.862 0 12/2/2026
11.0.861 0 12/2/2026
11.0.860 0 12/2/2026
11.0.859 0 12/2/2026
11.0.858 0 12/2/2026
11.0.857 0 12/2/2026
11.0.856 44 12/1/2026
11.0.855 40 12/1/2026
11.0.854 43 12/1/2026
11.0.853 40 12/1/2026
11.0.852 50 12/1/2026
11.0.851 47 12/1/2026
11.0.850 48 12/1/2026
11.0.849 50 12/1/2026
11.0.848 47 12/1/2026
11.0.847 50 12/1/2026
11.0.846 54 12/1/2026
11.0.845 64 11/30/2026
11.0.844 74 11/30/2026
11.0.843 63 11/30/2026
Loading failed

Update dependency Soenneker.Extensions.Arrays.Bytes to 11.0.84 (#1343)