# Pipeline based on specific branch?

**URL:** <https://community.jenkins.io/t/pipeline-based-on-specific-branch/1914>\
**Category:** Ask a question\
**Created:** [March 24, 2022, 12:46pm UTC](https://community.jenkins.io/t/pipeline-based-on-specific-branch/1914 "2022-03-24T12:46:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![masonb81](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@masonb81](https://community.jenkins.io/u/masonb81)\
**Post date:** [March 24, 2022, 12:46pm UTC](https://community.jenkins.io/t/pipeline-based-on-specific-branch/1914/1 "2022-03-24T12:46:54Z")

</div>

We would like to have a pipeline which builds no matter which branch is checked into git and have custom logic in the script based on the branch name such as getting access to the ${env.BRANCH\_NAME} variable.

I’ve setup a multi branch pipeline how ever it seems to run multiple builds for all the branches in the pipeline where as I would want to see just 1 build run and it to use the Jenkinsfile in that specific branch of the git project.
