Skip to content

Commit cf424b9

Browse files
Use NuGet trusted publishing instead of API keys
1 parent b55862f commit cf424b9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/release-template.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
env:
1111
NUGET_REPO_URL: "https://api.nuget.org/v3/index.json"
1212

13+
permissions:
14+
id-token: write
15+
1316
jobs:
1417
CLI:
1518
name: 🚚 Prepare new release
@@ -37,8 +40,13 @@ jobs:
3740
path: |
3841
**/*.nupkg
3942
README.md
43+
- name: NuGet login (OIDC → temp API key)
44+
uses: NuGet/login@v1
45+
id: login
46+
with:
47+
user: christian.helle
4048
- name: Push packages to NuGet
41-
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source ${{ env.NUGET_REPO_URL }} --no-symbols
49+
run: dotnet nuget push **/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source ${{ env.NUGET_REPO_URL }} --no-symbols
4250
- name: Create tag
4351
uses: actions/github-script@v8
4452
with:

0 commit comments

Comments
 (0)