Skip to content

Commit e37387c

Browse files
docs(nuget): github secrets
1 parent 8e902fa commit e37387c

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

installation/nuget.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This article also offers some troubleshooting information in case you encounter
2525
* [I do not see the Telerik Packages](#i-do-not-see-the-telerik-packages)
2626
* [CI and CD Automated Builds](#ci-and-cd-automated-builds)
2727
* Azure
28+
* GitHub Secrets
2829

2930
## Video Tutorial - Visual Studio
3031

@@ -164,6 +165,39 @@ A few things to double check to ensure correct setup:
164165
* The credentials being used have a UI for Blazor license.
165166
* Make sure that you use `dotnet restore` and not `nuget restore` in your pipeline step.
166167

168+
169+
#### GitHub Secrets
170+
171+
In some cases, [GitHub Secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) are used to store credentials that you would later have to consume from the `nuget.config` file in order to connect to the Telerik feed.
172+
173+
A way to pass them along is to mark them as environment variables. You can find an example in the [MediaFileManager repo by Lance McCarthy](https://github.com/LanceMcCarthy/MediaFileManager). Here follow the two relevant extracts.
174+
175+
>caption Example of getting GitHub Secrets for Telerik Login into Environment Variables
176+
177+
````YAML
178+
jobs:
179+
build:
180+
runs-on: windows-latest
181+
182+
env:
183+
TELERIK_USERNAME: ${ { secrets.TELERIK_USERNAME } } # remove the space between the brackets
184+
TELERIK_PASSWORD: ${ { secrets.TELERIK_PASSWORD } } # remove the space between the brackets
185+
````
186+
187+
Then, read them as such in the `nuget.config` file, for example:
188+
189+
>caption Example of reading the environment variables with the Telerik credentials in the nuget.config file
190+
191+
````XML
192+
<packageSourceCredentials>
193+
<Telerik>
194+
<add key="Username" value="%TELERIK_USERNAME%" />
195+
<add key="ClearTextPassword" value="%TELERIK_PASSWORD%" />
196+
</Telerik>
197+
</packageSourceCredentials>
198+
````
199+
200+
167201
## See Also
168202

169203
* [What You Need To Install]({%slug getting-started/what-you-need%})

0 commit comments

Comments
 (0)