nuget-github-packages

Publish .NET NuGet packages to GitHub Packages with authenticated pushes.

9|1|Updated Jul 21, 2025
One-click install
npx skills add https://github.com/usepowershell/PoshMcp --skill nuget-github-packages
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nuget-github-packages
Source: https://github.com/usepowershell/PoshMcp/tree/main/.squad/skills/nuget-github-packages
Command: npx skills add https://github.com/usepowershell/PoshMcp --skill nuget-github-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a repeatable, secure pattern for packing and publishing .NET NuGet packages to GitHub Packages so teams can distribute internal artifacts without manual credential juggling or registry misconfiguration.

Core Features & Use Cases

  • Authenticated Publishing: Use gh auth token to obtain a GitHub PAT with the required write:packages scope and push packages with dotnet nuget push.
  • Flexible Owner Resolution: Resolve the package feed owner from the git remote for repo-specific publishing or via the gh API for dynamic scenarios.
  • Developer and CI Support: Works for local developer machines, build agents, and CI/CD pipelines with guidance for one-time source setup and common gotchas.

Quick Start

Pack the project in Release, retrieve a GitHub PAT with gh auth token, resolve the owner from the git remote, and push the resulting nupkg to the https://nuget.pkg.github.com/{owner}/index.json feed using dotnet nuget push.

Frequently Asked Questions about nuget-github-packages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I publish a NuGet package to GitHub Packages using the dotnet CLI?▼

To publish a NuGet package to GitHub Packages, use the dotnet CLI to pack your project and push the resulting nupkg file to your GitHub Packages feed using a personal access token for authentication.

What GitHub token scopes are required to push NuGet packages to GitHub Packages?▼

Pushing NuGet packages to GitHub Packages requires a GitHub personal access token with the write:packages scope, which can be retrieved using the gh auth token command for authenticated publishing.

How do I resolve the owner for my GitHub Packages NuGet feed?▼

You can resolve the GitHub Packages feed owner automatically from the git remote for repository-specific publishing, or dynamically via the gh API for organization-owned package registries.

Can I use this NuGet publishing process in a CI/CD pipeline?▼

Yes, the NuGet publishing process works on local developer machines and CI/CD pipelines, providing a repeatable pattern for build agents to push packages without manual credential juggling.

What is the GitHub Packages feed URL format for pushing .NET packages?▼

The GitHub Packages feed URL for pushing .NET packages follows the format https://nuget.pkg.github.com/{owner}/index.json, where the owner is resolved from your git remote or the gh API.

Why does dotnet nuget push fail with authentication errors to GitHub Packages?▼

Authentication errors during dotnet nuget push occur when the GitHub personal access token lacks the write:packages scope or when the source feed is misconfigured, requiring proper gh auth token setup.