Skip to content

Commit b16b926

Browse files
committed
Updated publish action to use trusted publishing pattern.
1 parent e29ec01 commit b16b926

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- 'v[1-9].*'
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
build:
1014
runs-on: ubuntu-latest
@@ -65,12 +69,14 @@ jobs:
6569
- name: Publish eslint-config-rock-recommended
6670
run: npm publish --access public
6771
working-directory: ./src/eslint-config-rock-recommended
68-
env:
69-
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}
7072
- name: Publish obsidian-build-tools
7173
run: npm publish --access public
7274
working-directory: ./src/obsidian-build-tools
73-
env:
74-
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}
75+
# Get a short-lived NuGet API key
76+
- name: NuGet login
77+
uses: NuGet/login@v1
78+
id: login
79+
with:
80+
user: SparkDevNetwork
7581
- name: Publish
76-
run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
82+
run: dotnet nuget push *.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)