Skip to content

Commit 06f6b57

Browse files
committed
configures nuget publish with OIDC
Uses OIDC to retrieve a temporary API key for NuGet publishing.
1 parent f448daf commit 06f6b57

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/_publish.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
env:
55
DOTNET_INSTALL_DIR: "./.dotnet"
66
DOTNET_ROLL_FORWARD: "Major"
7-
7+
88
jobs:
99
publish:
1010
name: ${{ matrix.taskName }}
@@ -33,7 +33,16 @@ jobs:
3333
with:
3434
name: nuget
3535
path: ${{ github.workspace }}/artifacts/packages/nuget
36+
37+
-
38+
name: NuGet login (OIDC → temp API key)
39+
uses: NuGet/login@v1
40+
id: login
41+
with:
42+
user: 'gittoolsbot'
3643
-
3744
name: '[Publish]'
3845
shell: pwsh
39-
run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }}
46+
env:
47+
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
48+
run: dotnet run/publish.dll --target=Publish${{ matrix.taskName }}

0 commit comments

Comments
 (0)