# Update Jenkins build status in GitHub pull requests

**URL:** <https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407>\
**Category:** Using Jenkins\
**Created:** [September 17, 2021, 10:16am UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407 "2021-09-17T10:16:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rakesh](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rakesh](https://community.jenkins.io/u/Rakesh)\
**Post date:** [September 17, 2021, 10:16am UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407/1 "2021-09-17T10:16:01Z")

</div>

Hello,  
I am trying to integrate GitHub and Jenkins via GitHub Actions selfhosted **Runner** yaml file ( **not via webhooks** ). I am looking solution to track back the Jenkins build status in GitHub pull requests.  
I have explored many Jenkins plugins like GitHub Pull Request Builder, set GitHub commits via post build actions, etc. but its not working.  
I am assuming as I am not using Web-hook, these plug-ins are not able to do their job.  
Are there any other plugins / yaml script for this use-case?

runner yaml file:  
name: Create Jenkins Links workflow

on: [push, pull\_request]  
jobs:

Jenkins-links-creation:  
runs-on: [self-hosted, Windows,my-runner]  
env:  
JOB\_ENV: True # This is accesible for the job  
Jenkins\_GITHUB\_ENDPOINT: “[https://rb-jmaas.de.bosch.com/PS-EC\_Playground/github-webhook/](https://rb-jmaas.de.bosch.com/PS-EC_Playground/github-webhook/)”  
HEADER\_CONTENT\_TYPE: “Content-Type: application/json”  
HEADER\_GITHUB\_EVENT: “x-github-event: ${{ github.event\_name }}”

```
steps:
  - name: List Environment variables
    run: set
    shell: cmd
  - name: Invoke Jenkins endpoint
    shell: cmd
    run: | 
      curl -X POST --data @%GITHUB_EVENT_PATH% "%Jenkins_GITHUB_ENDPOINT%" -H "%HEADER_CONTENT_TYPE%" -H "%HEADER_GITHUB_EVENT%"
```

---

<div class="post-metadata">

**Author:** ![shadycuz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shadycuz/32/196_2.png) [@shadycuz](https://community.jenkins.io/u/shadycuz)\
**Post date:** [September 17, 2021, 11:38am UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407/2 "2021-09-17T11:38:12Z")

</div>

So you want run a GitHub action and that action will trigger a build in Jenkins?

Then follow the steps here [How to build a job using the REST API and cURL? – CloudBees Support](https://support.cloudbees.com/hc/en-us/articles/218889337-How-to-build-a-job-using-the-REST-API-and-cURL-?page=67)

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 17, 2021, 5:07pm UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407/3 "2021-09-17T17:07:02Z")

</div>

I’m super curious why your not using webhooks. It is it some sort of security thing so the github action is running on a server inside your network and you want to still notify jenkins.

As far as I know, if your using the github branch source for your job, it should update the status back to github, doesn’t matter how its triggered.

---

<div class="post-metadata">

**Author:** ![Rakesh](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rakesh](https://community.jenkins.io/u/Rakesh)\
**Post date:** [September 20, 2021, 3:58am UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407/4 "2021-09-20T03:58:08Z")

</div>

Yes it happens via Webhook. But not via GitHub actions runner directly.  
In our case GitHub is on Cloud (Internet) & Jenkins is over Intranet. Due to some security & firewall settings Its not possible to use WebHooks. So Runner is in place.

---

<div class="post-metadata">

**Author:** ![shadycuz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shadycuz/32/196_2.png) [@shadycuz](https://community.jenkins.io/u/shadycuz)\
**Post date:** [September 21, 2021, 12:41pm UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407/5 "2021-09-21T12:41:42Z")

</div>

> [@Rakesh](#):
>
> GitHub Actions selfhosted **Runner** yaml file

What do you mean by runner? A GitHub Actions runner? Or the Jenkinsfile Runner?

> [@Rakesh](#):
>
> I am looking solution to track back the Jenkins build status in GitHub pull requests

So the Jenkins is being triggered and running the build? Or you are trying to trigger Jenkins to run the build?

> [@Rakesh](#):
>
> In our case GitHub is on Cloud (Internet) & Jenkins is over Intranet.

This is pretty common setup, if you can’t open a connection for a webhook, then your only real option to trigger a build is with SCM polling, which isn’t really that bad as long as you use jitter so the polling doesn’t trigger all at once.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [September 21, 2021, 5:15pm UTC](https://community.jenkins.io/t/update-jenkins-build-status-in-github-pull-requests/407/6 "2021-09-21T17:15:35Z")

</div>

> [@shadycuz](#):
>
> What do you mean by runner? A GitHub Actions runner? Or the Jenkinsfile Runner?

Sounds like they have a github actions agent connected to github, and that agent is turning around and curling/posting to jenkins.

I personally would still post to the /github-webhooks endpoint, I just don’t know the structure to use. i’m sure if you look at the github plugin tests you can see what structure is needed.

> [@Rakesh](#):
>
> etc. but its not working.

Is there an error message? What are you expecting it to do? What did it do?
