Jenkins and GitHub webhook: HTTP 403

后端 未结 4 1662
失恋的感觉
失恋的感觉 2020-12-08 16:51

I have a GitHub repository which I would like to have notify Jenkins of new commits via a post-receive hook. I\'ve installed the GitHub plugin into Jenkins and have allowed

4条回答
  •  眼角桃花
    2020-12-08 17:23

    From Github's instructions ("Configuring global authentication", the first section),

    1. Create a user in Jenkins which has, at a minimum, Job/Build permissions
    
    2. Log in as that user (this is required even if you are a Jenkins admin user), then click on the user's name in the top right corner of the page
    
    3. Click 'Configure,' then 'Show API Token...', and note/copy the User ID and API Token.
    
    4. In GitLab, when you create webhooks to trigger Jenkins jobs, use this format for the URL and do not enter anything for 'Secret Token': http://USERID:APITOKEN@JENKINS_URL/project/YOUR_JOB
    

    In my case I used http://USERID:APITOKEN@myIPaddress:808/ and no project/YOUR_JOB

提交回复
热议问题