简体   繁体   中英

MultiBranch pipeline github webhook

Title pretty much says it all. I've seen these:

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

I have a github server setup in jenkins, but cannot choose it in the multibranch source (as one of the links suggests), it asks for credentials but no credentials are in the dropdown.

I've also setup a github webhook, but I dont think it makes any difference

So, you need just add(create) this credentials in order to be able choose them in dropdown. It could be API key or SSH key. One of your links includes the manual how generate API key:

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.

You can find more information on the GitHub token permissions here: https://support.cloudbees.com/hc/en-us/articles/234710368-GitHub-User-Scopes-and-Organization-Permission

I hope it will help you.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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