Soenneker.GitHub.FileStore
4.0.642
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.GitHub.FileStore --version 4.0.642
NuGet\Install-Package Soenneker.GitHub.FileStore -Version 4.0.642
<PackageReference Include="Soenneker.GitHub.FileStore" Version="4.0.642" />
<PackageVersion Include="Soenneker.GitHub.FileStore" Version="4.0.642" />
<PackageReference Include="Soenneker.GitHub.FileStore" />
paket add Soenneker.GitHub.FileStore --version 4.0.642
#r "nuget: Soenneker.GitHub.FileStore, 4.0.642"
#:package Soenneker.GitHub.FileStore@4.0.642
#addin nuget:?package=Soenneker.GitHub.FileStore&version=4.0.642
#tool nuget:?package=Soenneker.GitHub.FileStore&version=4.0.642
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 | Versions 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. |
-
net10.0
- Soenneker.Extensions.Arrays.Bytes (>= 4.0.66)
- Soenneker.GitHub.ClientUtil (>= 4.0.627)
- Soenneker.Utils.File (>= 4.0.2242)
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 |
|---|---|---|
| 4.0.646 | 27 | 9/1/2026 |
| 4.0.645 | 26 | 9/1/2026 |
| 4.0.644 | 27 | 9/1/2026 |
| 4.0.643 | 28 | 9/1/2026 |
| 4.0.642 | 43 | 8/31/2026 |
| 4.0.641 | 41 | 8/31/2026 |
| 4.0.640 | 43 | 8/31/2026 |
| 4.0.639 | 44 | 8/31/2026 |
| 4.0.638 | 42 | 8/31/2026 |
| 4.0.637 | 48 | 8/31/2026 |
| 4.0.636 | 50 | 8/31/2026 |
| 4.0.635 | 42 | 8/31/2026 |
| 4.0.634 | 43 | 8/30/2026 |
| 4.0.633 | 66 | 8/30/2026 |
| 4.0.632 | 58 | 8/30/2026 |
| 4.0.631 | 49 | 8/30/2026 |
| 4.0.630 | 53 | 8/30/2026 |
| 4.0.628 | 44 | 8/29/2026 |
| 4.0.627 | 50 | 8/29/2026 |
| 4.0.625 | 48 | 8/29/2026 |
Update dependency Soenneker.GitHub.ClientUtil to 4.0.627 (#1134)