File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,14 @@ jobs:
4242 - name : Pack NuGet package
4343 run : dotnet pack SWEN3.Paperless.RabbitMq/SWEN3.Paperless.RabbitMq.csproj --configuration Release --no-build --output ./nupkg -p:GeneratePackageOnBuild=false
4444
45- - name : Publish packages to NuGet.org
45+ - name : Publish packages to NuGet.org (Trusted Publishing)
4646 if : github.event_name == 'release' || github.event_name == 'workflow_dispatch'
4747 run : |
48+ # Request OIDC token for NuGet Trusted Publishing
49+ OIDC_TOKEN=$(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
50+ "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r '.value')
51+
4852 dotnet nuget push ./nupkg/*.nupkg \
4953 --source https://api.nuget.org/v3/index.json \
50- --api-key ${{ secrets.NUGET_API_KEY }} \
54+ --api-key "$OIDC_TOKEN" \
5155 --skip-duplicate
You can’t perform that action at this time.
0 commit comments