Search code examples
bitbucket-pipelines

Bitbucket pipelines workspace variables vs repository variables. Which will be called if both are present?


I am trying to develop multiple pipelines in bitbucket and want to understand Which variable will be called if both workspace variables and repository variables are present with same name?

Under Wroksapce variable I have FOO=BAR

Under Repository variable I have FOO=YES

So when I call from pipeline $FOO what will be the output?


Solution

  • Per the documentation:

    The order of overrides is Deployment > Repository > Workspace > Default variables

    So, in this case, repository variables take precedence over workspace variables of the same name, so FOO would have the value YES.