nuget-trusted-publishing

Configure GitHub Actions OIDC trusted publishing for NuGet packages.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill nuget-trusted-publishing-1k-off
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: nuget-trusted-publishing
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/nuget-trusted-publishing
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill nuget-trusted-publishing-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the risk and maintenance burden of long-lived NuGet API keys by switching NuGet publishing to OIDC-based trusted publishing on GitHub Actions.

Core Features & Use Cases

  • GitHub Actions OIDC setup for nuget.org: Guides the user through trusted publishing using id-token: write and NuGet/login@v1.
  • Greenfield and migration support: Creates a new tag-triggered publish workflow for new packages or updates an existing workflow to remove API key usage safely.
  • Repo validation safeguards: Helps classify packable project types (library, template, dotnet tool, MCP server), check required metadata like PackageId/Version, and avoid version/filename mismatches.

Quick Start

Use this skill to set up trusted publishing for a public nuget.org NuGet package by creating the GitHub Actions workflow using OIDC and confirming the nuget.org trusted publishing policy first.

Frequently Asked Questions about nuget-trusted-publishing

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

FAQPage Schema
How do I publish NuGet packages without API keys using GitHub Actions?▼

NuGet trusted publishing uses GitHub Actions OIDC to issue short-lived tokens via NuGet/login@v1, replacing long-lived API keys. It requires setting permissions id-token: write in your workflow and configuring the nuget.org trusted publishing policy beforehand.

What is NuGet trusted publishing and how does OIDC work for dotnet packages?▼

NuGet trusted publishing is an OIDC-based mechanism that exchanges a GitHub Actions identity token for a short-lived NuGet publishing token. It removes the need to store long-lived API keys by verifying the workflow's origin and permissions on each run.

How do I migrate an existing GitHub Actions workflow from API keys to OIDC for NuGet?▼

To migrate an existing workflow to OIDC trusted publishing, you update your publish workflow to remove API key usage and replace it with the NuGet/login@v1 action while setting permissions id-tag: write. The process safely transitions dotnet libraries, tools, and templates to short-lived tokens.

Can I use OIDC trusted publishing for dotnet tools and MCP server packages on nuget.org?▼

Yes, OIDC trusted publishing supports publishing dotnet libraries, tools, templates, and MCP server packages to nuget.org. The setup validates packable project metadata like PackageId and Version to ensure successful tag-triggered deployments.

What are the limitations of using OIDC tokens for NuGet publishing in CI/CD?▼

A key limitation is the strict requirement for workflow filename alignment and valid packable project metadata. Version or filename mismatches will break the tag-triggered publish workflow, and you must validate the nuget.org trusted publishing policy before setup.