travis-ci / beta-features

The perfect place to leave feedback and comments on newly released Beta Features.
56 stars 68 forks source link

Secured variable with build stages #49

Closed LaurentGoderre closed 6 years ago

LaurentGoderre commented 6 years ago

I'm having difficulties with using build stages with secured variable

https://travis-ci.org/nodejs/docker-node/jobs/362173107#L460 https://github.com/nodejs/docker-node/blob/build-test2/.travis.yml#L48-L49

Am I doing something wrong?

kenman345 commented 6 years ago

I think you're encrypting the wrong thing. For the GH token, to include it in your .travis.yml itself you would want to encrypt the token name with the value: GITHUB_API_TOKEN=[GITHUB_API_TOKEN value goes here] and then insert that into your .travis.yml

alternatively, you could type in GITHUB_API_TOKEN in the settings->Environment Variables menu for Travis-CI.org and then input the token value into the variables field and make sure it says "OFF" for the 'Display value in build log' option before hitting Add. When you add it this way, you wont even need to worry its not being involved in a particular build, as its going to be imported to every build and will never show the true value. It will not be available to users forks off the repository though, even on PRs to that repository

LaurentGoderre commented 6 years ago

Thanks, I found the issue. I meant to close this before.