environment-variables - 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
?
解决方案
是否有策略设置未加密且未在 .travis.yml 中定义的环境变量?
在 Travis.ci 中定义变量时,启用在 Build Log 中显示值的开关。
这将产生不加密变量的效果,并且该变量将可用于拉取请求构建。
这适用于所有可以为您的存储库提出 PR 的用户都被信任知道 Coveralls API 密钥的情况。
推荐阅读
- css - 如何强制我的 HTML 文件在其文件夹之外进行搜索?
- android - 当有多个片段时,浮动操作按钮放置在哪里
- solr - 如何在日期范围内但基于 Solr 中的文本格式信息搜索文档?
- jquery - 使用 jQuery 引用引导表单验证的 is-invalid 和 :invalid 伪类以仅在表单有效时运行代码
- android-tv - Android TV(leanback)中的持久标头片段(禁用动画)
- amazon-web-services - 在 AWS API Gateway -> Lambda 函数中重新调整流?
- postgresql - 在 SQL 中查找平均值的百分比 (%) 范围
- django - 过滤日期:TypeError at / expected string or bytes-like object
- python - 重新分配唯一值 - pandas DataFrame
- javascript - 在字符串 javascript 中查找并用空格替换“%20”