TL;DR: Use YAML anchors: [code: definitions: steps: - step: &Test-step name: Run tests script: - npm install - npm run test - step: &Deploy-step name: Deploy to staging deployment: staging script: - npm install - npm run build - fab deploy pipelines: default: - step: *Test-step - step: *Deploy-step branches: master: - step: *Test-step - step: <<: *Deploy-step name: Deploy to production deployment: production trigger: manual ] Docs: YOUR_HOST.atlassian.com/bitbucket/yaml-anchors-960154027.html

## Fix
1. Use YAML anchors: [code: definitions: steps: - step: &Test-step name: Run tests script: - npm install - npm run test - step: &Deploy-step name: Deploy to staging deployment: staging script: - npm install - npm run build - fab deploy pipelines: default: - step: *Test-step - step: *Deploy-step branches: master: - step: *Test-step - step: <<: *Deploy-step name: Deploy to production deployment: production trigger: manual ] Docs: YOUR_HOST.atlassian.com/bitbucket/yaml-anchors-960154027.html.
   Expected: this specific failure stops.

## When to use
You hit exactly this: Bitbucket Pipelines share SOME steps between branches in Bitbucket Pipelines.

## When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.

## Compatibility
Bitbucket Pipelines.