首页 > 解决方案 > Create unencrypted environment variables for Travis builds of Private Repos without defining them in .travis

问题描述

I have a private GitHub Repo and I have autorised particular users to be able to create their own private forks of this repo.

I have Travis configured to generate code coverage which is sent to coveralls.io, where the API key is stored in an environment variable that is encrypted.

Travis encrypts environment variables and does not make them available to forks. This means PRs for my repo do not get code coverage reports before they are merged.

I understand that Travis does not make encrypted environment variables available to forks because this would expose the variable where the repo is public and anyone could generate a build.

In my case, my repo is private and I trust the users I have allowed to fork it. So it would be fine for these variables to not be encrypted.

But I do not want to put the variables in .travis.yml because whilst I trust who has forked the repo, there are other parties who are not permitted to fork the repo who can still see the code (i.e. where copies of the code are kept on servers, or in backups.)

Is there a strategy to set an evironment variable that is not encrypted and not defined in .travis.yml?

标签: environment-variablestravis-ci

解决方案


是否有策略设置未加密且未在 .travis.yml 中定义的环境变量?

在 Travis.ci 中定义变量时,启用在 Build Log 中显示值的开关。

这将产生不加密变量的效果,并且该变量将可用于拉取请求构建。

这适用于所有可以为您的存储库提出 PR 的用户都被信任知道 Coveralls API 密钥的情况。


推荐阅读