How to prevent a particular branch from building

In my GitHub repository there are multiple branches. I want only feature/develop branches to be built. So I have not created any config.yml file in other branches. Still when code is committed to other branches they are getting build. I found below configuration to skip building particular branch.


But this requires config.yml file to be committed to each and every branch. Is my understanding correct or there is some other way around?

I had a similar issue to this originally. Those other branches are building as 1.0 right?

Never used 1.0, started off with 2.0 only but yeah all the branches are building. Above mentioned configuration only works if all branches have config.yml file.

Sorry, I think you misunderstood, and I probably wasn’t very clear.

I have never used 1.0 either however what I found out was that after I added a .circleci/config.yml into one branch and pushed it. All branches started building, my one with the 2.0 config and then all other pushes into the other branches that had zero circleci configuration still triggered 1.0 builds. I’m pretty sure that I had no filtering on the first config file that I pushed and this may have caused this behaviour. I’m just thinking that maybe this is causing what you mentioned above:

If you check the UI where you can see all the job across all your branches, on the right you’ll see either a 2.0 or 1.0 there. I’m thinking it just may provide insight into why the other branches are building without a config file in them, if you’ve hit the same issue as I did. Oh, and BTW there was no fix. I was told by support that it will stop being an issue when you can no longer perform 1.0 builds after 31st August. In the meantime, I was told that I need to put a 2.0 config file into the branch.

You are right @grahamw. All other branches which don’t have config.yml are getting built on 1.0 and the one with config.yml file is getting built on 2.0 as below.


:+1: Awesome, yeah, at least that’s likely the cause then. I didn’t need to play around with working out a minimal config that makes sense to drop into the other branches to prevent them from building, or at the very least to as little as possible before exiting. I suspect that you may just need to filter them out with the same only branch filter applied to the other 1.0 building branches. Hopefully you don’t have too many branches to do. :slight_smile:

Yeah @grahamw :slight_smile: , In my case committing minimum config file to each branch is the only option as of now. But I hope after 31 August it won’t be required and builds won’t get triggered until we have a config.yml in the branch.

1 Like

Sweet, glad you have a solution at least. :smile:

Hi @grahamw, I can see 1.0 builds are still triggering even for branches which doesn’t have any YAML file. This should not happen after 31 August 2018 as told to you by support team.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.