How to prevent custom revision on bamboo

Elifcan Çakmak March 3, 2023

Hello,

I would like to prevent custom revision on Bamboo. I know that it's not really possible in the interface. So I was thinking about a solution like failing the build whenever it's a custom revision. But when I try to use bamboo.planRepository.<position>.branchName variable even though it's a custom revision with a different branch, I still see the default branch in the build plan from the repository setting. 

So is there a way to prevent custom revisions? Or at least fail the build if it's a custom revision with a message?

Thanks in advance,

Best,

Elifcan

1 answer

1 accepted

1 vote
Answer accepted
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2023

Hello @Elifcan Çakmak

When running a Build with customized revisions via Run >> Run Customized >> Revision, Bamboo adds a "customRevision" variable to the build, or "${bamboo_customRevision}" when used by a shell script.

You can add a Script task as the first task of a Plan and check if the variable exists and cancel the build accordingly.

You can also combine it with checking the "planRepository.branch" variable to look for non-Default Plan branches.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events