File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 2626 MSBuildEnableWorkloadResolver : false
2727 name : ${{ matrix.os}}
2828 runs-on : ${{ matrix.vm}}
29+ permissions :
30+ id-token : write
31+ contents : read
2932 steps :
3033 - name : Support longpaths
3134 if : ${{ matrix.os == 'windows' }}
@@ -47,10 +50,18 @@ jobs:
4750 ~/.nuget/packages
4851 key : ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
4952
53+ # Use the ambient GitHub token to login to NuGet and retrieve an API key
54+ - name : NuGet login (OIDC → temp API key)
55+ uses : NuGet/login@v1
56+ id : login
57+ with :
58+ # Secret is your NuGet username, e.g. andrewlock
59+ user : ${{ secrets.NUGET_USER || 'andrewlock' }}
60+
5061 - name : Run './build.cmd Test Pack PushToNuGet GenerateSbom'
5162 run : ./build.cmd Test Pack PushToNuGet GenerateSbom
5263 env :
53- NuGetToken : ${{ secrets.NUGET_TOKEN || 'NOT_SET'}}
64+ NuGetToken : ${{ steps.login.outputs.NUGET_API_KEY || 'NOT_SET'}}
5465 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT : " true"
5566
5667 - uses : actions/upload-artifact@v4
You can’t perform that action at this time.
0 commit comments