git 如何为组织帐户生成 GitHub OAuth 令牌?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31159275/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I generate the GitHub OAuth token for organization accounts?
提问by davidrpugh
I have created an organization on GitHub. My organization has some repos. These repos have API documentation that I would like to re-build and publish to gh-pages
branch via Travis-CI. In order to give Travis-CI access to my organization's repos I need to generate an OAuth token, encrypt it, and then add then include the encypted token in the .travis.yml
file as follows...
我在 GitHub 上创建了一个组织。我的组织有一些回购。这些存储库有 API 文档,我想gh-pages
通过 Travis-CI重新构建和发布到分支。为了让 Travis-CI 能够访问我组织的存储库,我需要生成一个 OAuth 令牌,对其进行加密,然后添加然后将加密的令牌包含在.travis.yml
文件中,如下所示......
env:
global:
- secure: "lots-of-seemingly-random-characters"
This SO postexplains the process and provides the details on how to do this for user accounts. How do I generate the required OAuth token for organization accounts?
这篇SO 帖子解释了该过程并提供了有关如何为用户帐户执行此操作的详细信息。如何为组织帐户生成所需的 OAuth 令牌?
回答by Ivan Zuzak
That's not possible currently, you can only create tokens for user accounts since user accounts have permissions associated with them (organizations don't). So, you'd need to create a token with an account which has access to the repository in question and give that to Travis. You can also create a machine account for that purpose.
目前这是不可能的,您只能为用户帐户创建令牌,因为用户帐户具有与其关联的权限(组织没有)。因此,您需要使用可以访问相关存储库的帐户创建令牌,并将其提供给 Travis。您还可以为此创建一个机器帐户。