Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to disable build trigger with new branch creation

After bamboo spec enablement for repo, any time someone creates a branch on the server, it immediately triggers a build. Even without any commits or code changes. Can we avoid building until an initial commit is pushed?

Before, Bamboo Spec enablement this was working as expected.

1 answer

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 06, 2022

Hello @ananda3

Welcome to Atlassian Community!

You can disable automatic branch creation by modifying the Plan settings under Branches:

Create plan branch
( ) Manually
( ) When a pull request is created
( ) When new branch in repository is created
( ) When new branch in repositoru is created and matches expression


Sincerely,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

@Eduardo Alvarenga 

I think this is not matching with the problem statement, we want to have new branch created but don't want to trigger the build with just new branch creation. We want build to be triggered when there is a commit in the created branch.

Currently, whenever a branch is getting created, it triggers the build in that plan branch.

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 07, 2022

Hello @ananda3

Thank you for providing more details on your request.

Bamboo will trigger a build by default on a Plan Branch creation. There is a Feature Request that covers your scenario, but unfortunately, that is still collecting votes for future implementation. We recommend you vote and watch that FR so you get notified once it move forward on its implementation.

As a workaround, you can add a single script task at the top of the very first Stage of your Plan that will exit if it's the first time the build is happening.

Windows:

if ( ${bamboo.buildNumber} -eq 1 ) {
  $host.ui.WriteErrorLine("First build on branch killed to avoid unnecessary build")
  exit 1
}

Linux:

if [ ${bamboo_buildnumber} -eq 1 ] ; then
  echo "First build on branch killed to avoid unnecessary build"
  exit 1
fi 

As a result, the first run after creating a branch will fail immediately and you will avoid unnecessary work.

Sincerely,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Like Gustavo Segura likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events