Show current state of Jenkins build on GitHub repo

前端 未结 12 1620
遥遥无期
遥遥无期 2020-11-28 17:34

Is there a way to show the Jenkins build status on my project\'s GitHub Readme.md?

I use Jenkins to run continuous integration builds. After each commit it ensures

12条回答
  •  天命终不由人
    2020-11-28 17:54

    In the meanwhile the UI of Jenkins and GitHub has changed a bit and it took me a while to figure out how to configure Jenkins now correctly. The explanation here is based on Jenkins version 2.121.1.

    I also assume that you have already configured your Jenkins Job be triggered by a webhook or by polling. Those are the steps that I have taken to get it working:

    1. Configure Github: Create Personal Access Token with OAuth Scope repo:status
    2. Configure Jenkins: Configure System and add the OAuth Secret as a GitHub Server - use Secret Text as an authentication method to put the OAuth Secret in there.
    3. Configure your Jenkins Job: Add Set GitHub commit status as Post-build action. Set the Status Result to One of the default messages and statuses.
    4. Check your result on GitHub: Check if you get the build status and build execution duration on your GitHub commit.

    Configure Github





    Configure Jenkins






    Configure Jenkins Job




    Result

    You will now see the status for your commits and branches:

提交回复
热议问题