Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Shared pipelines - how to use multiple steps

shainegordon August 17, 2025

As referenced here https://support.atlassian.com/bitbucket-cloud/docs/share-pipelines-configurations/ , I'm able to import and use a custom manually triggered step in our pipeline

pipelines:
custom:
create-master-to-develop-pr:
import: automation-scripts:master:create-master-to-develop-pr
create-release-branch-and-pr-into-master:
import: automation-scripts:master:create-release-branch-and-pr-into-master
intent-architect-ensure-no-outstanding-changes:
import: automation-scripts:master:intent-architect-ensure-no-outstanding-changes

this works great.

 

however, I want to also use these in branch specific steps

 

e.g.

branches:
'{develop}':
- step: *deployDev
- step:
import: automation-scripts:master:intent-architect-ensure-no-outstanding-changes


the bitbucket-pipeline.yml validator says this is "valid", but when these is executed, there we get an error

 

`No commands or pipes defined for the step at [pipelines > branches > {develop} > 1 > step]. Check that you have defined a valid "script" section.`

 

 

This is how our shared pipeline is defined:

 

export: true

definitions:
pipelines:
intent-architect-ensure-no-outstanding-changes: &intent-architect-ensure-no-outstanding-changes
- step:
name: Intent Architect CLI - ensure-no-outstanding-changes
image: mcr.microsoft.com/dotnet/sdk:9.0
caches:
- dotnetcore
script:
- dotnet tool install Intent.SoftwareFactory.CLI --global
- export PATH=$PATH:/root/.dotnet/tools
- intent-cli ensure-no-outstanding-changes $INTENT_USERNAME $INTENT_PASSWORD ./intent




Is it possible to do what I want?
Share steps on custom pipelines, and also as additional steps in branch piplines?

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 18, 2025

Hey @shainegordon 

Welcome to the community!

You are correct that you can import and use shared pipeline steps in custom pipelines using the import syntax. However, when it comes to using these shared steps as additional steps within a branch-specific pipeline (i.e., mixing imported steps with local steps in a branch pipeline), Bitbucket Pipelines currently does not support this.

I can assist you in submitting a feature request if you share your use case. Please let me know why you need this feature and how it would benefit your team.

Regards,
Syahrul

shainegordon August 20, 2025

Thanks for the confirmation @Syahrul 

 

A typical use-case:
We use feature based development, and different branches are deployed to different environments: `develop` to `DEV`, `release/*` to 'UAT', `main` to `PROD`, etc

Often there are `hotfix/*` branches which get merged into `main`, and these changes need to make it back to `develop`, ideally automatically, via a PR

So our `main` pipeline looks like this

pipelines:
custom:
create-main-to-develop-pr:
- step: *createMainToDevelopPR //this works by changing to an import instead of step
branches
main:
- parallel:
- step: *buildAndPushNginxProduction
- step: *buildAndPushApiProduction
- step:
<<: *buildAndRunMigrations
name: Build and run Migrations - Production
deployment: Migrations - Production
- parallel:
- step: *deployNginxProduction
- step: *deployApiProduction
- step: *createMainToDevelopPR //this is a step that I would like to make accessible


The last step here creates the PR from `main` to `develop`. I'd rather that development teams dont need to manually have to define this entire step

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2025

Hi @shainegordon 

Thanks for the update. We have a related feature request here that I recommend you vote for and watch.

I hope this is helpful. Please remember to comment on the feature request if you have any additional information.

Regards,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events