Hi all,
I have a config file looks like this:
image: myimgpipelines: branches: release/*: - step:
- script:
- // I want to get branch name here, to pull exacly the branch name when deploy
Is there anyway to do that? Please help
Hi,
Pipelines provides default environment variables you can access in your configuration.
For your case specifically:
- script: - echo $BITBUCKET_BRANCH
For the full list, see the documentation.
Hope this helps!
That prints $BITBUCKET_BRANCH, not the actual name of the branch.
If you see something like this:+ echo $BITBUCKET_BRANCHthat is the command line.The actual output will print below this line and without the + sign.
It looks like you're new here. Sign in or register to get started.