# Developing pipeline.yml on a branch?

**URL:** <https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738>\
**Category:** Pipelines\
**Created:** [June 16, 2024, 4:47pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738 "2024-06-16T16:47:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aronchick](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@aronchick](https://forum.buildkite.community/u/aronchick)\
**Post date:** [June 16, 2024, 4:47pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/1 "2024-06-16T16:47:27Z")

</div>

I’m building a new pipeline, and want to do it on a branch. Is there a way to have the pipeline.yml file come from a branch? It appears that it can only come from main?

---

<div class="post-metadata">

**Author:** ![Priya](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@Priya](https://forum.buildkite.community/u/Priya)\
**Post date:** [June 16, 2024, 11:19pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/2 "2024-06-16T23:19:43Z")

</div>

Hey Aronchik,

Welcome to Buildkite community 👋

Pipeline can be run from any branch unless branch limiting is applied on it.

When you run new build on the UI, are you able to choose, different branch and run a build for it?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/2X/f/f8db3f1999d75975903ddd075b6e633573c5f955.png)

Could you also ensure under pipeline settings, repository settings no branch limiting is applied?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/2X/e/ea1d6639b25f5039a291bb0f1c02c78c76c6c327.png)

Let us know any sample build link if the issue persists so we can assist further.

Cheers,  
Priya

---

<div class="post-metadata">

**Author:** ![aronchick](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@aronchick](https://forum.buildkite.community/u/aronchick)\
**Post date:** [June 21, 2024, 7:00pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/3 "2024-06-21T19:00:09Z")

</div>

sorry, slightly different question.

i’m building a new pipeline.yml and i want to test out the pipeline on a branch before i check it in. as near as i can tell, i can only access the buildkite pipelines on main - am i missing something?

---

<div class="post-metadata">

**Author:** ![suma](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/suma/32/1306_2.png) [@suma](https://forum.buildkite.community/u/suma)\
**Post date:** [June 21, 2024, 7:48pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/4 "2024-06-21T19:48:12Z")

</div>

Hey @aronchick ,

As my colleague @Priya suggested, when you trigger a build through UI using the new build option, you can specify the branch on which you want to trigger the build.

So based on which branch you select, it will checkout that branch and use the pipeline.yml file from it. I hope this clarifies your question. If not, please let us know if you have any further questions.

Thanks,  
Suma

---

<div class="post-metadata">

**Author:** ![aronchick](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@aronchick](https://forum.buildkite.community/u/aronchick)\
**Post date:** [June 24, 2024, 2:58pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/5 "2024-06-24T14:58:22Z")

</div>

i think this gets at most of it - is there a way to trigger a build on a given sha or tag with an API call?

---

<div class="post-metadata">

**Author:** ![jared](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/jared/32/1304_2.png) [@jared](https://forum.buildkite.community/u/jared)\
**Post date:** [June 24, 2024, 3:03pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/6 "2024-06-24T15:03:51Z")

</div>

Hey @aronchick 👋

For sure, you can trigger a build using our REST API here: [Builds API | Buildkite Documentation](https://buildkite.com/docs/apis/rest-api/builds#create-a-build)

```auto
curl -H "Authorization: Bearer $TOKEN" \
  -X POST "https://api.buildkite.com/v2/organizations/{org.slug}/pipelines/{pipeline.slug}/builds" \
  -H "Content-Type: application/json" \
  -d '{
    "commit": "abcd0b72a1e580e90712cdd9eb26d3fb41cd09c8",
    "branch": "main",
    "message": "Testing all the things :rocket:",
    "author": {
      "name": "Keith Pitt",
      "email": "me@keithpitt.com"
    },
    "env": {
      "MY_ENV_VAR": "some_value"
    },
    "meta_data": {
      "some build data": "value",
      "other build data": true
    }
  }'

```

In the request body properties, you can specify a SHA or tag using the `commit` property (this is also outlined on the page, but here’s a screenshot for reference):

 ![image](https://us1.discourse-cdn.com/flex016/uploads/buildkite1/original/2X/a/a6720d69f95ca76c9a344608271ce6d6a8628e0b.png)

Hope this answers your questions!

Thanks,  
Jared

---

<div class="post-metadata">

**Author:** ![aronchick](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@aronchick](https://forum.buildkite.community/u/aronchick)\
**Post date:** [June 25, 2024, 6:14pm UTC](https://forum.buildkite.community/t/developing-pipeline-yml-on-a-branch/3738/7 "2024-06-25T18:14:04Z")

</div>

this looks great - will do!
