多分支管道 github webhook

MultiBranch pipeline github webhook

标题几乎说明了一切。我看过这些:

How to trigger Multibranch Pipeline build with github webhook
https://support.cloudbees.com/hc/en-us/articles/224543927-GitHub-webhook-configuration
https://support.cloudbees.com/hc/en-us/articles/115003019232-GitHub-Webhook-Pipeline-Multibranch

我在 jenkins 中设置了 github 服务器,但无法在多分支源中选择它(如其中一个链接所示),它要求提供凭据,但下拉列表中没有凭据。

我还设置了一个 github webhook,但我认为这没有任何区别

因此,您只需添加(创建)此凭据即可在下拉列表中进行选择。它可以是 API 密钥或 SSH 密钥。您的其中一个链接包含如何生成 API 密钥的手册:

You need Credentials for each of the GitHub/GitHub Enterprise Server added here. Jenkins needs a Personal API token to interact with the GitHub via webhooks. This token can be either created manually or automatically (see next section). Credentials from User: Admin permissions are required at the repository level but Owner role is required to create it at Organization level; For updating commit statuses / reading the list of collaborators, Write permission is required. You can find more information on the GitHub token permissions in GitHub Permissions and API token Scopes for Jenkins.

Setting up the Credentials As explained in the previous section, the plugin needs a token to work. You can choose to let Jenkins create the token on your behalf, or create it manually.

Let Jenkins create the token: this option is only available if you are not using two-factor authentication. You can make Jenkins generate the token by going to Advanced > Manage Additional GitHub Actions > Convert Login and Password to token.

Generate the token yourself: first generate a token (make sure to read the previous section to understand what rights to grant). Then in the Credentials section (under the API URL) create a Credential of type Secret Text and put the token you generated as a secret text.

您可以在此处找到有关 GitHub 令牌权限的更多信息:https://support.cloudbees.com/hc/en-us/articles/234710368-GitHub-User-Scopes-and-Organization-Permission

希望对你有所帮助

我需要创建凭证,用户名等于用户名,密码等于 github 令牌