简体   繁体   English

使用 2FA 为 Github CI 配置 Jenkins

[英]Configure Jenkins For Github CI w/ 2FA

My Github account has two factor authorization (2fa) enabled.我的 Github 帐户启用了两因素授权 (2fa)。 I want to integrate Jenkins with a few of my private repositories, but I cannot authorize them because I have 2fa enabled.我想将 Jenkins 与我的一些私有存储库集成,但我无法授权它们,因为我启用了 2fa。 Note this is a multibranch pipeline project.请注意,这是一个多分支管道项目。

Any ideas how to configure Jenkins to connect with private repos without creating a dummy account that does not have 2fa enabled?任何想法如何配置 Jenkins 以连接私有存储库而不创建未启用 2fa 的虚拟帐户? 在此处输入图片说明

Whoever would have thought to click the help button?谁会想到点击帮助按钮?

Credentials used to scan branches and pull requests, check out sources and mark commit statuses.

If none is given, only the public repositories will be scanned, and commit status will not be set on GitHub.

If your organization contains private repositories, then you need to specify a credential from an user who have access to those repositories.
This is done by creating a "username with password" credential where the password is GitHub personal access tokens. The necessary scope is "repo"

ie use a Github personal access token as your password when using username/password for your Jenkins credential.即在使用用户名/密码作为 Jenkins 凭据时,使用Github 个人访问令牌作为密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM