Skip to content

Commit 1616a35

Browse files
committed
🧹 [chore] Remove GitHub Packages publishing from workflow
- Deleted `publishToGitHub` input and related steps from the publish workflow - Removed `PACKAGES_TOKEN` secret requirement and associated environment variable - Cleaned up permissions by removing unnecessary package write access Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
1 parent b3aab13 commit 1616a35

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

.github/workflows/publish.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
description: "Publish to NuGet.org (PowerShell Gallery uses same feed)"
88
required: false
99
default: "true"
10-
publishToGitHub:
11-
description: "Publish to GitHub Packages"
12-
required: false
13-
default: "true"
1410
versionOverride:
1511
description: "Override module version (optional)"
1612
required: false
@@ -27,8 +23,6 @@ on:
2723
required: false
2824
NUGETAPIKEY:
2925
required: false
30-
PACKAGES_TOKEN:
31-
required: false
3226
workflow_run:
3327
workflows: ["Tests"]
3428
types:
@@ -38,7 +32,6 @@ on:
3832

3933
permissions:
4034
contents: write
41-
packages: write
4235

4336
jobs:
4437
validate-and-publish:
@@ -47,9 +40,7 @@ jobs:
4740
env:
4841
PSGALLERYAPIKEY: ${{ secrets.PSGALLERYAPIKEY }}
4942
NUGETAPIKEY: ${{ secrets.NUGETAPIKEY }}
50-
PACKAGES_TOKEN: ${{ github.token }}
5143
PUBLISH_TO_NUGET_INPUT: ${{ github.event.inputs.publishToNuGet }}
52-
PUBLISH_TO_GITHUB_INPUT: ${{ github.event.inputs.publishToGitHub }}
5344
CREATE_RELEASE_INPUT: ${{ github.event.inputs.createRelease }}
5445
steps:
5546
- name: Harden the runner (Audit all outbound calls)
@@ -333,22 +324,3 @@ jobs:
333324
Write-Host "Publishing $packagePath to NuGet.org"
334325
dotnet nuget push $packagePath --api-key $apiKey --source https://api.nuget.org/v3/index.json --skip-duplicate
335326
shell: pwsh
336-
337-
- name: Publish to GitHub Packages
338-
if: ${{ env.PACKAGES_TOKEN != '' && (github.event_name != 'workflow_dispatch' || env.PUBLISH_TO_GITHUB_INPUT != 'false') }}
339-
run: |
340-
$packagePath = '${{ steps.package.outputs.packagePath }}'
341-
if (-not (Test-Path $packagePath)) {
342-
throw "Package not found at $packagePath"
343-
}
344-
345-
$token = $env:PACKAGES_TOKEN
346-
if ([string]::IsNullOrWhiteSpace($token)) {
347-
Write-Host 'No GitHub Packages token provided. Skipping publish.'
348-
return
349-
}
350-
351-
$source = "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
352-
Write-Host "Publishing $packagePath to GitHub Packages feed $source"
353-
dotnet nuget push $packagePath --api-key $token --source $source --skip-duplicate
354-
shell: pwsh

0 commit comments

Comments
 (0)