You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to set and use an encrypted GH_TOKEN/GITHUB_TOKEN environment variable with a personal OAuth token for GH? It is fairly straightforward for Travis CI and AppVeyor too.
It would be used by, for instance, the electron-builder and also it is a nice to have for vscode-ripgrep to avoid Error: API rate limit exceeded.
If this is possible, can someone please share a link to a sample configuration?
I would like to achieve the followings:
check out another private GitHub repository as part of the pipeline build,
use a private NPM registry during my build and publish there (yarn publish --no-git-tag-version could help though), and
deploy a new electron release to GH.
Thank you!
Solution:
Select your pipeline.
Click on Edit.
Click on Variables.
Define your variable. Make sure it is not a plain text.
azure-pipelines.yml:
pool:
vmImage: 'Ubuntu 16.04'steps:
- script: mkdir foo && cd foo && git init && git pull https://$GH_TOKEN@github.com/nameOrOrganization/repositoryName.git && ls -aldisplayName: 'Clone with a predefined GitHub OAuth token'env:
GH_TOKEN: $(gh.token)
The text was updated successfully, but these errors were encountered:
kittaakos
changed the title
[Question] Set and use an encrypted environment variable
[Solved][Question] Set and use an encrypted environment variable
Nov 21, 2018
It works 🎉 @TingluoHuang, thank you for the pointer.
I made several mistakes, but honestly, it is misleading that I must not use $(GH_TOKEN) but $GH_TOKEN in the script. See the second example here. I assume it is because I did not use $(variables.GH_TOKEN) format.
Is it possible to set and use an encrypted
GH_TOKEN
/GITHUB_TOKEN
environment variable with a personal OAuth token for GH? It is fairly straightforward for Travis CI and AppVeyor too.It would be used by, for instance, the electron-builder and also it is a nice to have for
vscode-ripgrep
to avoidError: API rate limit exceeded
.If this is possible, can someone please share a link to a sample configuration?
I would like to achieve the followings:
yarn publish --no-git-tag-version
could help though), andThank you!
Solution:
Edit
.Variables
.azure-pipelines.yml
:The text was updated successfully, but these errors were encountered: