# Trigger Pipeline when there's a change in Github repository

**URL:** <https://community.jenkins.io/t/trigger-pipeline-when-theres-a-change-in-github-repository/2204>\
**Category:** Ask a question\
**Created:** [April 22, 2022, 11:57am UTC](https://community.jenkins.io/t/trigger-pipeline-when-theres-a-change-in-github-repository/2204 "2022-04-22T11:57:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrianfusco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/adrianfusco/32/1376_2.png) [@adrianfusco](https://community.jenkins.io/u/adrianfusco)\
**Post date:** [April 22, 2022, 11:57am UTC](https://community.jenkins.io/t/trigger-pipeline-when-theres-a-change-in-github-repository/2204/1 "2022-04-22T11:57:05Z")

</div>

Hello,

I’ve been reading a lot of different posts and documentation about this topic. I also took a look in another similar question: [GitHub build trigger on PR](https://community.jenkins.io/t/github-build-trigger-on-pr/1268)

I was wondering if exists a way to trigger a pipeline checking if there’s some change in a GitHub repository (when it’s opened a PR or when it’s merged - maybe checking with some hash the last commit and check if it changed `git rev-parse HEAD`).

I can’t use webhooks because the Jenkins is local.

Any idea?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![saper](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/saper/32/138_2.png) [@saper](https://community.jenkins.io/u/saper)\
**Post date:** [April 22, 2022, 12:18pm UTC](https://community.jenkins.io/t/trigger-pipeline-when-theres-a-change-in-github-repository/2204/2 "2022-04-22T12:18:49Z")

</div>

Can you try if [multibranch pipeline](https://www.jenkins.io/doc/book/pipeline/multibranch/) does what you want? It will scan the repo and start jobs if there are any changes.

---

<div class="post-metadata">

**Author:** ![adrianfusco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/adrianfusco/32/1376_2.png) [@adrianfusco](https://community.jenkins.io/u/adrianfusco)\
**Post date:** [April 22, 2022, 12:40pm UTC](https://community.jenkins.io/t/trigger-pipeline-when-theres-a-change-in-github-repository/2204/3 "2022-04-22T12:40:50Z")

</div>

Thank you for your answer @saper . I’ll take a look into this and check if it’s possible to use this option without adding the `Jenkinsfile` in the repository. The idea is to execute a pipeline that already exists in the Jenkins side just if there’s a change. Maybe it can works.

I’ll let you know.

Thank you again!

---

<div class="post-metadata">

**Author:** ![adrianfusco](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/adrianfusco/32/1376_2.png) [@adrianfusco](https://community.jenkins.io/u/adrianfusco)\
**Post date:** [April 22, 2022, 1:07pm UTC](https://community.jenkins.io/t/trigger-pipeline-when-theres-a-change-in-github-repository/2204/4 "2022-04-22T13:07:25Z")

</div>

It works really nice. Thank you very much!
