How to Display Jenkins Build Status Badge on GitHub
![How To Display Jenkins Build Status Badge On Github](/media/roglyg3o/how-to-display-jenkins-build-status-badge-on-github.jpg?format=webp&quality=80)
Table of contents
What is Embeddable Build Status Plugin?
This plugin allows Jenkins to expose what is the current state of your last build or a specific build as an image icon (badge) via fixed URL.
Note: This is applicable to Jenkins 2.222.1 and Embeddable Build Status Plugin 2.0.3. Perhaps it works for previous versions as well.
5 steps for displaying Jenkins build status badge on GitHub
- Open Jenkins -> Manage Jenkins -> Manage Plugins
- Install Embeddable Build Status Plugin from the Available tab
- On the project level or the entire Jenkins level, assign Anonymous Users with the ViewStatus Job permission
- From the specific build page or branch build page on Jenkins click on the Embeddable Build Status link and copy the value from the Markdown unprotected box
- Paste it in the README.md on a GitHub project
![how_to_display_jenkins_build_status_badge_on_github.png](/media/csydtd3c/how_to_display_jenkins_build_status_badge_on_github.png?quality=80)
Embeddable Build Status link
![how_to_display_jenkins_build_status_badge_on_github_2.png](/media/faqk5ct2/how_to_display_jenkins_build_status_badge_on_github_2.png?quality=80)
Pasting README.md on a GitHub project
Note that the link from the markdown can be omitted, so only the badge image gets displayed.
As the final result, you should see the following.
![how_to_display_jenkins_build_status_badge_on_github_3.png](/media/ktubfhol/how_to_display_jenkins_build_status_badge_on_github_3.png?quality=80)
Your display jenkins build status badge is now on GitHub
Troubleshooting with Display Jenkins Build Status Badge on GitHub - The image is broken or not shown
GitHub is doing an image link anonymization, which means images are being prefetched, cached, and not served directly from Jenkins. As GitHub performs a strict SSL verification, it will fail if the certificate is invalid or your Jenkins JKS does not contain a full certificate chain. In that case, you have to recreate it.
After you fix the certificate issue, make sure to purge Camo’s cache. A Camo link can be obtained from the README.md preview mode or by simply inspecting the HTML from the browser.