My project uses a mix of Repository and Deployments variables. Repository variables are being fetched correctly but there is something wrong with deployment vars for each pipeline. Below I'm attaching my bitbucket-pipelines.yaml file and a setup in Repository settings -> Deployments
Echo script were only to check if the values are being passed.
BITBUCKET_DEPLOYMENT_ENVIRONMENT was empty while the rest were present in a