Skip to content

Commit 3232583

Browse files
committed
fix: update publish workflow to use environment variable for NuGet API key
1 parent f9a5ab9 commit 3232583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/publishpackage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ jobs:
114114
# 6. Publish module
115115
Write-Host "🚀 Publishing module to PowerShell Gallery..." -ForegroundColor Yellow
116116
try {
117-
Publish-Module -Path $ModulePath -NuGetApiKey $nugetkey -Verbose -Force
117+
Publish-Module -Path $ModulePath -NuGetApiKey $env:nugetkey -Verbose -Force
118118
Write-Host "🎉 Module published successfully!" -ForegroundColor Green
119119
Write-Host "📦 Module link: https://www.powershellgallery.com/packages/$ModuleName" -ForegroundColor Cyan
120120
}
121121
catch {
122122
Write-Error "❌ Module publishing failed: $_"
123123
Write-Host "📋 Attempting to publish with SkipAutomaticTags..." -ForegroundColor Yellow
124124
try {
125-
Publish-Module -Path $ModulePath -NuGetApiKey $nugetkey -Verbose -Force -SkipAutomaticTags
125+
Publish-Module -Path $ModulePath -NuGetApiKey $env:nugetkey -Verbose -Force -SkipAutomaticTags
126126
Write-Host "🎉 Module published successfully (with SkipAutomaticTags)!" -ForegroundColor Green
127127
Write-Host "📦 Module link: https://www.powershellgallery.com/packages/$ModuleName" -ForegroundColor Cyan
128128
}

0 commit comments

Comments
 (0)