You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  GitHub Webhook
\\

!1 Configure GitHub Webhook

This page demonstrates the configuration of GitHub Webhook.

[{TableOfContents}]%%warning
Make sure there is a codebeamer user with the same username as the pusher in GitHub or use the pusher email ([see below|WIKIPAGE:3825088#section-Configure+GitHub+email+address+privacy])%!
%%warning
Make sure there is no repository in the project with the same name.%!

\\

!2 Configure codebeamer

Actions to be taken in codebeamer:

# Create user(s) who has the same username as the pusher(s) in GitHub
# Add the secret token of the webhook to codebeamer configuration ([see below|WIKIPAGE:3825088#section-1-Configure+GitHub+webhook])

Steps to configure secret token in codebeamer:

* Go to codebeamer~'s ''System Admin'' page
* Go to ''Application Configuration''
* Add {{"scc"}} node if it does not exist in your json (json root level)
* Add {{"github"}} node if it does not exist in your json under {{"scc"}} node
* Add {{"secretToken":"<secret~_token~_of~_the~_webhook~>"}} under {{"github"}} node

Example:

[!cb_app_json_external_scm.png!]

!2 Configure GitHub Webhook

Steps to configure GitHub webhook:

* Navigate to the ''Settings'' page of a repository
* Choose ''Webhooks'' menu
* Click to ''Add webhook''
* Fill out the fields
** ''Payload URL:'' <codebeamer~_url~>/rest/scm/github/<project~_id~>\\
 Where ''codebeamer~_url'' is the url of your codebeamer and ''project~_id'' is the id of your project where the GitHub repository will belong to after the first webhook execution\\
 Example: {{https://codebeamer.com/cb/rest/scm/github/1}}
** ''Content type:'' application/json
** ''Secret:'' codebeamer validates the source of the requests with the Secret Token. It is required to set the same ''SecretToken'' in GitHub and in codebeamers~'s Application Configuration too ([see above|WIKIPAGE:3825088#section-Configure+codeBeamer])
* Select ''Enable SSL verification'' or ''Disable (not recommended)'' according to your codebeamer server SSL configuration
* Select ''Just the push event'' (codebeamer supports only push event)
* Click on __~[Add webhook~]__

[!addWebhook.png#3e8d417b86ef3b8d5ed4d4afd5faa617!]

!2 Configure GitHub Email Address Privacy
%%warning
This feature is available since codebeamer 9.5.%!

In case there is no user in codebeamer with the same username as the pusher in GitHub~, codebeamer will use the user for repository operations who has the same email address as the pusher.

Make sure GitHub use the correct email address in webhooks.

For more information~, see: [https://help.github.com/en/articles/setting-your-commit-email-address#setting-your-commit-email-address-on-github]