我一直在 Jenkins 中使用 Git 插件从 GitHub 存储库中提取源代码。
我一直在使用用户名和密码进行身份验证
但是,GitHub 有 announced
Deprecation Notice: GitHub will discontinue password authentication to the API. You must now authenticate to the GitHub API with an API token, such as an OAuth access token, GitHub App installation access token, or personal access token, depending on what you need to do with the token
所以我需要更改身份验证以使用 oAuth token 。
1> 我在 GitHub 中创建了一个 oAuth token
2> 然后在 Jenkins 我创建了
Secret Text
作为全局凭证。 (使用 GitHub 的 oAuth token )3> 但是,当我转到作业配置时,Git 插件不会在类型为
secret text
的 DropDownList 中显示任何凭据。 (虽然它显示了所有其他凭据)我如何配置 Git Pug-in 以使用 oAuth token ?
最佳答案
首先检查您是否有 github-oauth
Jenkins 插件已安装,如“Use the Jenkins OAuth plug-in to securely pull from GitHub”中所述,来自 Walker Rowe .
这将允许将您的 Jenkins 服务器注册为一个可以访问 GitHub 资源的应用程序:
关于jenkins - 如何使用 github oAuth token 和 Git 插件 Jenkins,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59383728/