Skip to content

Commit 4b7889a

Browse files
amis92Copilot
andauthored
ci: use NUGET_USER_NAME env secret for trusted publishing (#266)
- publish.yml: use secrets.NUGET_USER_NAME instead of hardcoded user - deploy-command.yml: add secrets: inherit to pass env secrets - README: document NUGET_USER_NAME secret requirement Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c5f0055 commit 4b7889a

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

.github/workflows/deploy-command.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
push-to: ${{ github.event.client_payload.slash_command.args.named.env || 'github' }}
2222
tag: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'tag' }}
2323
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
24+
secrets: inherit

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
uses: NuGet/login@v1
113113
id: nuget-login
114114
with:
115-
user: warhub
115+
user: ${{ secrets.NUGET_USER_NAME }}
116116

117117
- name: Push to nuget.org
118118
if: env.PUSH_TO == 'all' || env.PUSH_TO == 'nuget'

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ NuGet.org publishing uses [Trusted Publishing](https://learn.microsoft.com/en-us
119119
The `push` job in `publish.yml` uses `environment: package-release` which provides
120120
environment protection rules (e.g. required reviewers) as a gate before publishing.
121121

122+
The NuGet profile name is configured via the `NUGET_USER_NAME` environment secret
123+
on the `package-release` environment.
124+
122125
### Tagging
123126

124127
Tags can also be created via the **Tag** workflow:

0 commit comments

Comments
 (0)