{"id":13811,"date":"2018-11-27T01:25:11","date_gmt":"2018-11-27T01:25:11","guid":{"rendered":"https:\/\/app14743.cloudwayssites.com\/blog\/?p=3811"},"modified":"2024-11-14T10:24:51","modified_gmt":"2024-11-14T15:24:51","slug":"how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial","status":"publish","type":"post","link":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/","title":{"rendered":"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]"},"content":{"rendered":"\n<p>I regularly use <a href=\"https:\/\/jenkins.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Jenkins CI<\/a> and <a href=\"https:\/\/github.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a> to help our customers integrate <a href=\"https:\/\/app14743.cloudwayssites.com\/?utm_term=&amp;utm_source=web-referral&amp;utm_medium=blog&amp;utm_content=&amp;utm_campaign=blog-evergreen-campaign&amp;utm_subgroup=\" target=\"_blank\" rel=\"noreferrer noopener\">Applitools<\/a> into their continuous integration workflow. Even though I\u2019m pretty familiar with both tools, one thing drives me nuts.<\/p>\n\n\n\n<p>Here\u2019s the problem: I can\u2019t see Jenkins build status in my GitHub repo pull request. Below is a screenshot of a typical GitHub pull request. As you can see, there\u2019s no indication of my Jenkins build status.<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/github-not-showing-jenkins-status.png\" alt=\"\" class=\"wp-image-3813\"\/><\/figure>\n\n\n\n<p>This forces me to leave GitHub and go to Jenkins every time I merge, just so I can check the build status.<\/p>\n\n\n\n<p>Doing this once is no big deal. But after doing this for a hundred pull requests, I feel like pulling my hair out (and that would just look weird).<\/p>\n\n\n\n<p>This is especially frustrating since other continuous integration servers, like <a href=\"https:\/\/travis-ci.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Travis<\/a> and <a href=\"https:\/\/circleci.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Circle CI<\/a>, make this easy.<\/p>\n\n\n\n<p>Since Jenkins is the <a href=\"https:\/\/blog.github.com\/2017-11-07-github-welcomes-all-ci-tools\/\" target=\"_blank\" rel=\"noreferrer noopener\">third most popular continuous integration tool<\/a> used with GitHub (after Travis and Circle CI), you\u2019d think this issue would have been solved.<\/p>\n\n\n\n<p>But when I started looking online for a way to solve this issue. I found some good resources, but not one document that described the process from beginning to end with all the configurations needed.<\/p>\n\n\n\n<p>So, to spare you the pain I\u2019ve gone through trying to make this work, I wrote this end-to-end tutorial on how to update Jenkins build status in the GitHub pull request page.<\/p>\n\n\n\n<p>So let\u2019s dive in!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-the-big-picture\">The Big Picture<\/h2>\n\n\n\n<p>To get a better understanding of the interaction between those tools and the problem they present, see the following diagram. The red marks are the parts that are missing and this post is attempting to fix.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg\" alt=\"Integrating Jenkins &amp; GitHub\" class=\"wp-image-3814\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-get-the-basics-in-place\">Get the basics in place<\/h2>\n\n\n\n<p>To follow the steps below, you just need a couple of things:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A <a href=\"https:\/\/github.com\/\">GitHub<\/a> account.<\/li>\n\n\n\n<li>A <a href=\"https:\/\/jenkins.io\/download\/\">Jenkins server up<\/a> and running on a <a href=\"https:\/\/www.techopedia.com\/definition\/27229\/static-url\" target=\"_blank\" rel=\"noreferrer noopener\">static URL<\/a>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-you-will-do-in-this-tutorial\">What you will do in this tutorial:<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Setup GitHub\n<ol class=\"wp-block-list\">\n<li>Install Jenkins plugin<\/li>\n\n\n\n<li>Generate a GitHub access token<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>Setup Jenkins\n<ol class=\"wp-block-list\">\n<li>Install Hudson Post Build Task plugin<\/li>\n\n\n\n<li>Call the GitHub API<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;3) Bask in the awesomeness of your technical prowess<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-setup-github\">Setup GitHub<\/h2>\n\n\n\n<p>So, how to get GitHub set up with Jenkins? These steps explain.<\/p>\n\n\n\n<p>What you\u2019ll do here is install the Jenkins plugin on your GitHub repository in order to trigger a build in Jenkins when you commit a change in GitHub. This way, Jenkins can run tests to make sure your code is working as expected.<\/p>\n\n\n\n<p>On your GitHub account, go to your repository and configure a webhook to the Jenkins server:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your browser, go to your GitHub account. The URL should be something like\u00a0<a href=\"http:\/\/www.github.com\/your_username\">www.github.com\/your_username<\/a><\/li>\n\n\n\n<li>Go into one of your repositories<\/li>\n\n\n\n<li>Click on <strong>Settings<\/strong>, on the upper right part of the page<\/li>\n\n\n\n<li>Click on <strong>Webhooks<\/strong><\/li>\n\n\n\n<li>Click on <strong>Add Webhook<\/strong><\/li>\n\n\n\n<li>Set the <strong>payload url<\/strong> to &lt;http:\/\/your_jenkins_server_url>\/github-webhook\/<\/li>\n\n\n\n<li>Set <strong>Content type<\/strong> to <strong>application\/json<\/strong><\/li>\n\n\n\n<li>Select the event you would like the webhook to be triggered by (I set my webhook to be triggered by \u201cJust the push event\u201d.<\/li>\n\n\n\n<li>Click on <strong>Add webhook<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Here\u2019s what those steps look like visually:<\/p>\n\n\n\n<p>So, how to get GitHub setup with Jenkins? These steps explain.<\/p>\n\n\n\n<p>What you\u2019ll do here is <strong>install the Jenkins plugin<\/strong> on your GitHub repository in order to trigger a build in Jenkins when you commit a change in GitHub. This way, Jenkins can run tests to make sure your code is working as expected.<\/p>\n\n\n\n<p>On your GitHub account, go to your repository and install the Jenkins plugin:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your browser, go to your GitHub account. The URL should be something like www.github.com\/your_username<\/li>\n\n\n\n<li>Go into one of your repositories<\/li>\n\n\n\n<li>Click on <strong>Settings<\/strong>, on the upper right part of the page<\/li>\n\n\n\n<li>Click on <strong>Integrations and services<\/strong><\/li>\n\n\n\n<li>Click on <strong>Add service<\/strong><\/li>\n\n\n\n<li>Search for <strong>Jenkins<\/strong><\/li>\n\n\n\n<li>Add your Jenkins static URL or IP.<\/li>\n\n\n\n<li>Click on <strong>Add service<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Here\u2019s what those steps look like visually.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/SetupGithub1.png\" alt=\"\" class=\"wp-image-6238\"\/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/SetupGithub2.png\" alt=\"\" class=\"wp-image-6239\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-generate-a-github-access-token\">Generate a GitHub access token<\/h2>\n\n\n\n<p>You will need to generate a GitHub access token for security purposes. This token can be used by an application to use an API, here the application is Jenkins and the API is the GitHub API to update the Jenkins build status in the pull request.<\/p>\n\n\n\n<p>&nbsp;Ok, now you\u2019re on to some non-obvious items.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to your GitHub account.<\/li>\n\n\n\n<li>Under your profile, open the drop-down menu and click on <strong>Settings<\/strong>.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-23-16.22.45.png\" alt=\"\" class=\"wp-image-3819\"\/><\/figure><\/div>\n\n\n<p>3. Go to <strong>Developer settings<\/strong> on the left side menu, all the way on the bottom:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-23-16.25.07.png\" alt=\"\" class=\"wp-image-3820\"\/><\/figure><\/div>\n\n\n<p>4. Click on <strong>Personal access tokens<\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-23-16.26.35.png\" alt=\"\" class=\"wp-image-3821\"\/><\/figure><\/div>\n\n\n<p>5. On the top right corner of the screen click on the <strong>Generate new token<\/strong> button.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-23-16.27.32.png\" alt=\"\" class=\"wp-image-3822\"\/><\/figure><\/div>\n\n\n<p>6. Insert your password.<\/p>\n\n\n\n<p>7. Under <strong>repo<\/strong> check the <strong>repo:status<\/strong> checkbox.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-23-16.28.33.png\" alt=\"\" class=\"wp-image-3823\"\/><\/figure><\/div>\n\n\n<p>9. Click on <strong>Generate token<\/strong> at the bottom of the page.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-23-16.29.39.png\" alt=\"\" class=\"wp-image-3824\"\/><\/figure><\/div>\n\n\n<p>10. Make sure to save your token somewhere so you can use it later, such as in the curl commands above.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-jenkins-setup\">Jenkins setup<\/h2>\n\n\n\n<p>So, how to get Jenkins working with GitHub? Let\u2019s show you how.<\/p>\n\n\n\n<p>What you\u2019ll do here is set up your Jenkins project to run your automation tests and call the GitHub API to update the status of the commit with success or failure.<\/p>\n\n\n\n<p>Install GitHub plugin:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your browser, go to your Jenkins URL<\/li>\n\n\n\n<li>Click on <strong>Manage Jenkins<\/strong><\/li>\n\n\n\n<li>Click on <strong>Manage Plugins<\/strong><\/li>\n\n\n\n<li>Go to <strong>Available<\/strong> tab and search for <strong>GitHub integration plugin<\/strong><\/li>\n\n\n\n<li>Check the checkbox on the left and click on <strong>download and install after restart<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Setup GitHub configuration:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to your GitHub project<\/li>\n\n\n\n<li>Click on Configure<\/li>\n\n\n\n<li>On the top bar, click on Source code management<\/li>\n\n\n\n<li>Check the Git \u00a0checkbox<\/li>\n\n\n\n<li>Paste the repository URL that you would like to integrate with under repository URL.<\/li>\n\n\n\n<li>Set the Branch to integrate with under Branch specified.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-24-06.12.55.png\" alt=\"\" class=\"wp-image-3828\"\/><\/figure><\/div>\n\n\n<p>Now that you have GitHub setup, do the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your browser, go to your Jenkins URL<\/li>\n\n\n\n<li>Click on <strong>Manage Jenkins<\/strong><\/li>\n\n\n\n<li>Click on <strong>Manage Plugins<\/strong><\/li>\n\n\n\n<li>Click on <strong>Install <\/strong><strong>Hudson Post Build Task<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Here\u2019s what you\u2019ll see when you run each of those commands. First, the Manage Jenkins command, in the menu bar on the left side:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/JenkinsSetup1WithNotes.png\" alt=\"\" class=\"wp-image-3831\"\/><\/figure><\/div>\n\n\n<p>Next, the Manage Plugins command.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/JenkinsSetup2.png\" alt=\"\" class=\"wp-image-3832\"\/><\/figure><\/div>\n\n\n<p>And finally, the Install Hudson build task command.<\/p>\n\n\n<div class=\"wp-block-image size-full wp-image-3833\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/JenkinsSetup3.png\" alt=\"\" class=\"wp-image-3833\"\/><figcaption class=\"wp-element-caption\">Hudson post-build task<\/figcaption><\/figure><\/div>\n\n\n<p>(In case you\u2019re wondering why you\u2019re installing a Hudson plugin and not a Jenkins plugin, it\u2019s because of this interesting bit of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hudson_(software)\">CI historical trivia<\/a>.)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-install-hudson-post-build-task-plugin\">Install Hudson Post Build Task plugin<\/h2>\n\n\n\n<p>The next step is to go into your Jenkins project <a href=\"https:\/\/wiki.jenkins.io\/display\/JENKINS\/Post+build+task\" target=\"_blank\" rel=\"noreferrer noopener\">post build actions<\/a>, and add two <strong>post build tasks<\/strong>. One task for success, and another for failure. You will need those actions to distinguish between a successful build and a build that failed.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The plugin name could also be called \u201cpost build task\u201d<\/li>\n<\/ul>\n\n\n\n<p>Define those build actions as follows:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-24-08.55.26.png\" alt=\"\" class=\"wp-image-3834\"\/><\/figure><\/div>\n\n\n<p>What you are doing is looking for the words \u201cSUCCESS\u201d or \u201cFAILURE\u201d in the Jenkins log. When you find \u201cSUCCESS\u201d, you run a script that uses the <a href=\"https:\/\/en.wikipedia.org\/wiki\/CURL\">curl command<\/a> to call the <a href=\"https:\/\/developer.github.com\/webhooks\/\">GitHub webhook API<\/a> to set the build status of the commit that started the build in GitHub pull request. The commit identifier, the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Secure_Hash_Algorithms\">SHA<\/a>, is accepted by Jenkins within an environment variable &#8211; $GIT_COMMIT. Similarly, if you find \u201cFAILURE\u201d in the Jenkins log, you use curl to let GitHub know that the Jenkins build failed.<\/p>\n\n\n\n<p>Either way, the status will be updated in the pull request. And, if you run Applitools tests, the Applitools status will also be updated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-call-the-github-api\">Call the GitHub API<\/h2>\n\n\n\n<p>For log entries containing \u201c<strong>SUCCESS<\/strong>\u201d, here\u2019s the post-build command that you want Jenkins to run:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/SophieDePaula\/f38d8c24b3dd3da628b032a8da5a4ea9.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/SophieDePaula\/f38d8c24b3dd3da628b032a8da5a4ea9\">Gist<\/a>.<\/noscript><\/div>\n<\/div><\/figure>\n\n\n\n<p>And for log entries containing \u201c<strong>FAILURE<\/strong>\u201d, here\u2019s the post-build command that you want Jenkins to run::<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/SophieDePaula\/15f7bd0353c16c646ceaef6b4788a24d.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/SophieDePaula\/15f7bd0353c16c646ceaef6b4788a24d\">Gist<\/a>.<\/noscript><\/div>\n<\/div><\/figure>\n\n\n\n<p>Notice that you will need to replace the following with your relevant info:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&lt;GitHubUserName> &#8211; from GitHub<\/li>\n\n\n\n<li>&lt;REPO_NAME> &#8211; from GitHub<\/li>\n\n\n\n<li>&lt;YOUR_GITHUB_TOKEN><\/li>\n\n\n\n<li>&lt;YOUR_JENKINS_URL><\/li>\n\n\n\n<li>&lt;JenkinsProjectName> &#8211; your Jenkins project name<\/li>\n<\/ul>\n\n\n\n<p>Let\u2019s dig into these post-build commands, using the <a href=\"https:\/\/curl.haxx.se\/docs\/manpage.html\">curl man pages<\/a>.<\/p>\n\n\n\n<p>As you can see, these are having curl request a URL from api.github.com. This URL has your GitHub username, repository name, and access token in it.<\/p>\n\n\n\n<p>You\u2019re sending a JSON snippet in the header of the HTTP request, as specified by the -H option. And you\u2019re sending an HTTP POST request, as indicated by the -X flag. And the data that post command is sending, indicated by -d, is a bit of JSON with either success or failure, your Jenkins URL, and your Jenkins project name.<\/p>\n\n\n\n<p>(That\u2019s some pretty complex curl you got going!)<\/p>\n\n\n\n<p>Once you get it set up be sure to give yourself a pat on the back. Or a nice Belgian waffle with whipped cream and strawberries. (I know which one I\u2019d pick!)<\/p>\n\n\n\n<p>So, where do you get all this information?<\/p>\n\n\n\n<p>To get this info, you\u2019ll do the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>GitHub Username<\/strong> &#8211; This should be your GitHub username. Hopefully, this is obvious.<\/li>\n\n\n\n<li><strong>GitHub Repository Name<\/strong> &#8211; You can find the name of any particular GitHub repo at the top of its page. In the example below, the repo name is Applitools-GitHubIntegration.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-24-09.01.28.png\" alt=\"\" class=\"wp-image-3835\"\/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Jenkins URL<\/strong> &#8211; This should be the base URL of your Jenkins server. This is simply the URL you put into your browser to access Jenkins, without anything to the right of the domain name. For example, if you have a Jenkins server setup on <a href=\"https:\/\/searchaws.techtarget.com\/definition\/Amazon-Elastic-Compute-Cloud-Amazon-EC2\">Amazon EC2<\/a>, it might look something like this:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">http:\/\/ec2-53-70-132-187.compute-1.amazonaws.com\/<\/pre>\n\n\n\n<p>In order for GitHub to find your Jenkins server, you should plug in your <a href=\"https:\/\/en.wikipedia.org\/wiki\/Fully_qualified_domain_name\" target=\"_blank\" rel=\"noreferrer noopener\">fully qualified domain name<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Jenkins Project Name<\/strong> &#8211; which you can see in the Jenkins UI as shown below.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/JenkinsProjectNameWithNotes.png\" alt=\"\" class=\"wp-image-3836\"\/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>Now that you\u2019ve configured both Jenkins and GitHub, the commit status will be shown in the GitHub pull request page when you merge a PR:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-24-09.34.15.png\" alt=\"\" class=\"wp-image-3838\"\/><\/figure><\/div>\n\n\n<p>As you can see, the Jenkins build status is now appearing in the pull request page.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/Screenshot-2018-11-24-09.35.57.png\" alt=\"\" class=\"wp-image-3839\"\/><\/figure><\/div>\n\n\n<p>Pretty nice, right?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-quick-answers\">Quick Answers<\/h2>\n\n\n\n<div class=\"wp-block-group pt-none pb-none\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1731025092682\"><strong class=\"schema-faq-question\">How can I display Jenkins build status in a GitHub pull request?<\/strong> <p class=\"schema-faq-answer\">To display Jenkins build status in a GitHub pull request, you need to integrate Jenkins with GitHub. This involves setting up webhooks in GitHub, installing necessary Jenkins plugins, and configuring Jenkins to communicate build status through the GitHub API.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1731597400164\"><strong class=\"schema-faq-question\">How do I configure a webhook in GitHub for Jenkins?<\/strong> <p class=\"schema-faq-answer\">To configure a webhook in GitHub, navigate to your repository settings, select Webhooks, and click on Add Webhook. Set the payload URL to your Jenkins server&#8217;s webhook endpoint, choose application\/json as the content type, and select the events that should trigger the webhook, such as &#8220;push&#8221;.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1731597423068\"><strong class=\"schema-faq-question\">What should I do if my Jenkins build status is not updating in GitHub?<\/strong> <p class=\"schema-faq-answer\">If the Jenkins build status is not updating in GitHub, check the following: ensure the webhook is correctly configured in GitHub, verify that the required plugins are installed and properly set up in Jenkins, and confirm that your GitHub access token is correctly used in the Jenkins configuration.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1731597430675\"><strong class=\"schema-faq-question\">What information do I need to set up the GitHub API call in Jenkins?<\/strong> <p class=\"schema-faq-answer\">To set up the GitHub API call in Jenkins, you need your GitHub username, repository name, Jenkins URL, and the Jenkins project name. These details are used in the curl command within post-build actions to update the build status in GitHub.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1731597444031\"><strong class=\"schema-faq-question\">Can I automate the process of updating Jenkins build status in GitHub?<\/strong> <p class=\"schema-faq-answer\">Yes, you can automate the process by configuring Jenkins to send API requests to GitHub post-build. This involves setting up scripts in Jenkins that trigger automatically upon build success or failure, ensuring the build status is always up-to-date in your GitHub pull requests.<\/p> <\/div> <\/div>\n\n\n\n<div class=\"wp-block-group pb-none pt-none\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<style>\n.schema-faq-section { \n  background: white;\n  margin: 1rem 0;\n  border: 2px solid rgba(0, 0, 0, 0.13);\n  border-radius: 10px;\n  box-shadow: 2px 2px 6px 2px rgba(0, 0, 0, 0.03);\n}\n.schema-faq-question{\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  transition: opacity ease 0.25s;\n  padding: 1rem;\n  color: var(--wp--preset--color--primary);\n  font-size: var(--wp--preset--font-size-large);\n}\n.schema-faq-question:hover {\n  color: var(--wp--preset--color--secondary);\n}\n.schema-faq-question:after{\n  width: 16px;\n  height: 20px;\n  display: inline-block;\n  margin-left: auto;\n  margin-right: 5px;\n  vertical-align: top;\n  color: inherit;\n  content: \"+\";\n}\n.schema-faq-question.expanded:after{\n  content: \"-\";\n}\n.schema-faq-question:hover{\n  opacity: 0.75;\n}\n.schema-faq-answer{\n  padding: 0 1rem 1rem 1rem;\n  display: none;\n}\n.schema-faq-answer.default{\n  display: block;\n}\n.editor-styles-wrapper .schema-faq-question {\n  cursor: text;\n}\n.editor-styles-wrapper .schema-faq-answer {\n  display: block; \n}\n<\/style>\n\n\n\n<script>\njQuery(function($){var yoast={accordion:function(){var isAnimating=!1;$(\".schema-faq-section\").find(\".schema-faq-question\").click(function(event){event.stopPropagation();if(isAnimating)return;isAnimating=!0;var answer=$(this).nextAll(\".schema-faq-answer\").eq(0);answer.slideToggle(250,function(){$(this).toggleClass(\"expanded\");$(this).prev(\".schema-faq-question\").toggleClass(\"expanded\");isAnimating=!1});$(\".schema-faq-answer\").not(answer).slideUp(\"fast\",function(){$(this).removeClass(\"expanded\");$(this).prev(\".schema-faq-question\").removeClass(\"expanded\")})})}};yoast.accordion()});\n<\/script>\n<\/div><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I regularly use Jenkins CI and GitHub to help our customers integrate Applitools into their continuous integration workflow. Even though I\u2019m pretty familiar with both tools, one thing drives me&#8230;<\/p>\n","protected":false},"author":28,"featured_media":13814,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[10004],"tags":[12782,12830,12691,10272,10086,12688,12690,12686],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.5 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Update Jenkins Build Status in Github Tutorial | Applitools<\/title>\n<meta name=\"description\" content=\"Simplify your CI workflow with Jenkins and GitHub. Learn how to integrate Jenkins build status in your GitHub pull requests.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]\" \/>\n<meta property=\"og:description\" content=\"I regularly use Jenkins CI and GitHub to help our customers integrate Applitools into their continuous integration workflow. Even though I\u2019m pretty\" \/>\n<meta property=\"og:url\" content=\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"AI-Powered End-to-End Testing | Applitools\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-27T01:25:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-14T15:24:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1058\" \/>\n\t<meta property=\"og:image:height\" content=\"725\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sophie Tagar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sophie Tagar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"25 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\"},\"author\":{\"name\":\"Sophie Tagar\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a2e35c71836e8064050a42b834a3aa79\"},\"headline\":\"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]\",\"datePublished\":\"2018-11-27T01:25:11+00:00\",\"dateModified\":\"2024-11-14T15:24:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\"},\"wordCount\":1960,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg\",\"keywords\":[\"CICD\",\"Code Snippets\",\"Developers\",\"GitHub\",\"Jenkins\",\"Technical Leaders\",\"Test Engineers\",\"Visual Testing Strategies\"],\"articleSection\":[\"Advanced Topics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\",\"name\":\"How to Update Jenkins Build Status in Github Tutorial | Applitools\",\"isPartOf\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg\",\"datePublished\":\"2018-11-27T01:25:11+00:00\",\"dateModified\":\"2024-11-14T15:24:51+00:00\",\"description\":\"Simplify your CI workflow with Jenkins and GitHub. Learn how to integrate Jenkins build status in your GitHub pull requests.\",\"breadcrumb\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731025092682\"},{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597400164\"},{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597423068\"},{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597430675\"},{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597444031\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg\",\"width\":1058,\"height\":725,\"caption\":\"Integrating Jenkins & GitHub\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advanced Topics\",\"item\":\"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#website\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"name\":\"Applitools Visual AI\",\"description\":\"Applitools delivers full end-to-end test automation with AI infused at every step.\",\"publisher\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#organization\",\"name\":\"Applitools\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"contentUrl\":\"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png\",\"width\":156,\"height\":28,\"caption\":\"Applitools\"},\"image\":{\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a2e35c71836e8064050a42b834a3aa79\",\"name\":\"Sophie Tagar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d59fbd44aad9d828a2c51bf004acc4b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d59fbd44aad9d828a2c51bf004acc4b?s=96&d=mm&r=g\",\"caption\":\"Sophie Tagar\"},\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/author\/sophietagar\/\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731025092682\",\"position\":1,\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731025092682\",\"name\":\"How can I display Jenkins build status in a GitHub pull request?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To display Jenkins build status in a GitHub pull request, you need to integrate Jenkins with GitHub. This involves setting up webhooks in GitHub, installing necessary Jenkins plugins, and configuring Jenkins to communicate build status through the GitHub API.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597400164\",\"position\":2,\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597400164\",\"name\":\"How do I configure a webhook in GitHub for Jenkins?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To configure a webhook in GitHub, navigate to your repository settings, select Webhooks, and click on Add Webhook. Set the payload URL to your Jenkins server's webhook endpoint, choose application\/json as the content type, and select the events that should trigger the webhook, such as \\\"push\\\".\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597423068\",\"position\":3,\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597423068\",\"name\":\"What should I do if my Jenkins build status is not updating in GitHub?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"If the Jenkins build status is not updating in GitHub, check the following: ensure the webhook is correctly configured in GitHub, verify that the required plugins are installed and properly set up in Jenkins, and confirm that your GitHub access token is correctly used in the Jenkins configuration.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597430675\",\"position\":4,\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597430675\",\"name\":\"What information do I need to set up the GitHub API call in Jenkins?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"To set up the GitHub API call in Jenkins, you need your GitHub username, repository name, Jenkins URL, and the Jenkins project name. These details are used in the curl command within post-build actions to update the build status in GitHub.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597444031\",\"position\":5,\"url\":\"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597444031\",\"name\":\"Can I automate the process of updating Jenkins build status in GitHub?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, you can automate the process by configuring Jenkins to send API requests to GitHub post-build. This involves setting up scripts in Jenkins that trigger automatically upon build success or failure, ensuring the build status is always up-to-date in your GitHub pull requests.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Update Jenkins Build Status in Github Tutorial | Applitools","description":"Simplify your CI workflow with Jenkins and GitHub. Learn how to integrate Jenkins build status in your GitHub pull requests.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]","og_description":"I regularly use Jenkins CI and GitHub to help our customers integrate Applitools into their continuous integration workflow. Even though I\u2019m pretty","og_url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/","og_site_name":"AI-Powered End-to-End Testing | Applitools","article_published_time":"2018-11-27T01:25:11+00:00","article_modified_time":"2024-11-14T15:24:51+00:00","og_image":[{"width":1058,"height":725,"url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg","type":"image\/jpeg"}],"author":"Sophie Tagar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sophie Tagar","Est. reading time":"25 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#article","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/"},"author":{"name":"Sophie Tagar","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a2e35c71836e8064050a42b834a3aa79"},"headline":"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]","datePublished":"2018-11-27T01:25:11+00:00","dateModified":"2024-11-14T15:24:51+00:00","mainEntityOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/"},"wordCount":1960,"commentCount":0,"publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg","keywords":["CICD","Code Snippets","Developers","GitHub","Jenkins","Technical Leaders","Test Engineers","Visual Testing Strategies"],"articleSection":["Advanced Topics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/","url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/","name":"How to Update Jenkins Build Status in Github Tutorial | Applitools","isPartOf":{"@id":"https:\/\/app14743.cloudwayssites.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg","datePublished":"2018-11-27T01:25:11+00:00","dateModified":"2024-11-14T15:24:51+00:00","description":"Simplify your CI workflow with Jenkins and GitHub. Learn how to integrate Jenkins build status in your GitHub pull requests.","breadcrumb":{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731025092682"},{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597400164"},{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597423068"},{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597430675"},{"@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597444031"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#primaryimage","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2018\/11\/APT_Jenkins_Gitgub_Diagram_2018-10-03-1.jpg","width":1058,"height":725,"caption":"Integrating Jenkins & GitHub"},{"@type":"BreadcrumbList","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/app14743.cloudwayssites.com\/"},{"@type":"ListItem","position":2,"name":"Advanced Topics","item":"https:\/\/app14743.cloudwayssites.com\/blog\/category\/advanced-topics\/"},{"@type":"ListItem","position":3,"name":"How to update Jenkins build status in GitHub pull requests [Step-by-Step Tutorial]"}]},{"@type":"WebSite","@id":"https:\/\/app14743.cloudwayssites.com\/#website","url":"https:\/\/app14743.cloudwayssites.com\/","name":"Applitools Visual AI","description":"Applitools delivers full end-to-end test automation with AI infused at every step.","publisher":{"@id":"https:\/\/app14743.cloudwayssites.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/app14743.cloudwayssites.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/app14743.cloudwayssites.com\/#organization","name":"Applitools","url":"https:\/\/app14743.cloudwayssites.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/","url":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","contentUrl":"https:\/\/app14743.cloudwayssites.com\/wp-content\/uploads\/2020\/03\/applitools.png","width":156,"height":28,"caption":"Applitools"},"image":{"@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/a2e35c71836e8064050a42b834a3aa79","name":"Sophie Tagar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/app14743.cloudwayssites.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d59fbd44aad9d828a2c51bf004acc4b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d59fbd44aad9d828a2c51bf004acc4b?s=96&d=mm&r=g","caption":"Sophie Tagar"},"url":"https:\/\/app14743.cloudwayssites.com\/blog\/author\/sophietagar\/"},{"@type":"Question","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731025092682","position":1,"url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731025092682","name":"How can I display Jenkins build status in a GitHub pull request?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To display Jenkins build status in a GitHub pull request, you need to integrate Jenkins with GitHub. This involves setting up webhooks in GitHub, installing necessary Jenkins plugins, and configuring Jenkins to communicate build status through the GitHub API.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597400164","position":2,"url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597400164","name":"How do I configure a webhook in GitHub for Jenkins?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To configure a webhook in GitHub, navigate to your repository settings, select Webhooks, and click on Add Webhook. Set the payload URL to your Jenkins server's webhook endpoint, choose application\/json as the content type, and select the events that should trigger the webhook, such as \"push\".","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597423068","position":3,"url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597423068","name":"What should I do if my Jenkins build status is not updating in GitHub?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"If the Jenkins build status is not updating in GitHub, check the following: ensure the webhook is correctly configured in GitHub, verify that the required plugins are installed and properly set up in Jenkins, and confirm that your GitHub access token is correctly used in the Jenkins configuration.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597430675","position":4,"url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597430675","name":"What information do I need to set up the GitHub API call in Jenkins?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"To set up the GitHub API call in Jenkins, you need your GitHub username, repository name, Jenkins URL, and the Jenkins project name. These details are used in the curl command within post-build actions to update the build status in GitHub.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597444031","position":5,"url":"https:\/\/app14743.cloudwayssites.com\/blog\/how-to-update-jenkins-build-status-in-github-pull-requests-step-by-step-tutorial\/#faq-question-1731597444031","name":"Can I automate the process of updating Jenkins build status in GitHub?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, you can automate the process by configuring Jenkins to send API requests to GitHub post-build. This involves setting up scripts in Jenkins that trigger automatically upon build success or failure, ensuring the build status is always up-to-date in your GitHub pull requests.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/13811"}],"collection":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/comments?post=13811"}],"version-history":[{"count":0,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/posts\/13811\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media\/13814"}],"wp:attachment":[{"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/media?parent=13811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/categories?post=13811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app14743.cloudwayssites.com\/wp-json\/wp\/v2\/tags?post=13811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}