---
# System prepended metadata

title: Jenkins webhook to github
tags: [CI/CD, Jenkins]

---

# Jenkins webhook to github

[Reference Doc.](https://blog.yowko.com/git-repository-jenkins-webhook/)

## Steps:

### 1. Add new user
> **Manage Jenkins** > **Configure Global Security** > **Access Control** > **Authorization** > **Project-based Matrix Authorization Strategy** > **Choose Autohority**

[Authority Reference](https://gist.github.com/4lun/50313ccd6c6f550a9763212d146aece3)

### 2. Create API Token
> **Manage Jenkins** > **Manage Users** > **Choose User** > **Configure** > **API Token** > **Generate Token**
 
### 3. Add webhook to github
1. go to github > webhook page
2. Setting

#### Payload URL:
```
http://{userid}:{token}@{JENKINS_URL}/job/{project name}/build?token={TOKEN_NAME}
```
#### Content type:
```
application/json
```

**Jenkins Remote Trigger Url:**
```shell=
{userid}:{token}@{JENKINS_URL}/job/{project name}/build?token={TOKEN_NAME}
```
#### Example:
```shell=
yuze1995:116d976831332112b32bd618e77af3403f@172.104.76.92:8080/job/dotnet_core_docker_example/job/master/build?token=githubtriggertoken
```


###### tags: `CI/CD` `Jenkins`