Skip to content

Commit 6670134

Browse files
committed
Fix NuGet managed identity
1 parent 927d5b5 commit 6670134

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ jobs:
9090
with:
9191
name: nugets
9292

93-
- uses: actions/setup-dotnet@v4
93+
# Get a short-lived NuGet API key
94+
- name: NuGet login (OIDC → temp API key)
95+
uses: NuGet/login@v1
96+
id: login
9497
with:
95-
dotnet-version: '8.0.x'
96-
source-url: https://api.nuget.org/v3/index.json
97-
env:
98-
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99-
100-
- run: dotnet nuget push *.nupkg *.snupkg --skip-duplicate
98+
user: ${{secrets.NUGET_USER}}
99+
100+
# Push the package
101+
- name: NuGet push
102+
run: dotnet nuget push *.nupkg *.snupkg --skip-duplicate --api-key ${{steps.login.outputs.NUGET_API_KEY}}

0 commit comments

Comments
 (0)