Skip to content
Discussion options

You must be logged in to vote

Trusted Publishing currently validates the workflow and repository where the token is actually obtained. When using shared workflows from another repo, the policy on NuGet needs to match the repository that contains the nuget/login step, which can cause 401 errors if it doesn’t.

There isn’t a direct way to pass a secret token safely as an output from one workflow to another due to GitHub restrictions. The most reliable approach is to keep the nuget/login step in the originating repo’s workflow and call shared workflows after obtaining the token, passing non-secret configuration or parameters only. This ensures the policy validation works and your token remains secure.

Replies: 2 comments 1 reply

This comment was marked as off-topic.

Comment options

You must be logged in to vote
1 reply
@rvdginste
Comment options

Answer selected by rvdginste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question Ask and answer questions about GitHub features and usage Workflow Configuration Topics about workflow files, YAML setup, job dependencies, and general workflow configuration issues Misc General discussions about GitHub Actions that don't fit other found themes.
3 participants