FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix secret fallback and add explicit workflow permissions in release.yml · pythonnet/pythonnet@1b36f36 · GitHub

Repository navigation

Commit 1b36f36

Browse files
andauthored
Fix secret fallback and add explicit workflow permissions in release.yml
Co-authored-by: filmor <30848+filmor@users.noreply.github.com>
1 parent 8923e9b commit 1b36f36

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- 'v*'
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
name: Build and Test
@@ -73,6 +76,7 @@ jobs:
7376
needs: build
7477
runs-on: ubuntu-latest
7578
permissions:
79+
contents: read
7680
id-token: write
7781
steps:
7882
- name: Download PyPI artifacts
@@ -104,6 +108,10 @@ jobs:
104108
dotnet-version: '10.0.x'
105109

106110
- name: Deploy to NuGet
111+
env:
112+
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
113+
NUGET_MONTHLY: ${{ secrets.NUGET_MONTHLY }}
107114
run: |
108-
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY || secrets.NUGET_MONTHLY }} --skip-duplicate nuget-dist/*.nupkg
109-
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY || secrets.NUGET_MONTHLY }} --skip-duplicate nuget-dist/*.snupkg
115+
API_KEY="${NUGET_API_KEY:-$NUGET_MONTHLY}"
116+
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key "$API_KEY" --skip-duplicate nuget-dist/*.nupkg
117+
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key "$API_KEY" --skip-duplicate nuget-dist/*.snupkg

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL