Skip to content

Committing secrets in parameter.json #1114

Answered by Basyras
IT-VBFK asked this question in Q&A
Discussion options

You must be logged in to vote

Your pipeline does not need to use parameters.json at all. If all secrets are found as environment variables I believe nuke is not even trying to read if from parameters.json. If you use Github actions you can simply add your secret as standard pipeline secret and in your _build.csproj you can access secrets like this

//from https://nuke.build/docs/cicd/github-actions/#importing-secrets
[GitHubActions(
    // ...
    ImportSecrets = new[] { nameof(NuGetApiKey) })]
class Build : NukeBuild
{
    [Parameter] [Secret] readonly string NuGetApiKey;
}

of course this force you to have secrets in 2 places in parameters.json when running locally and in Github Actions secrets when running the pipel…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@IT-VBFK
Comment options

@matkoch
Comment options

@IT-VBFK
Comment options

@IT-VBFK
Comment options

@matkoch
Comment options

Answer selected by IT-VBFK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants