I have a tag defined as following. And I want to retrieve the BRANCH name from where this pipeline is triggered. As per the documentation, the $BITBUCKET_BRANCH variable is only available for branches.
I need to get BRANCH name for the step "Send Slack". Any suggestion would be appreciated.
tags:
'dev/trigger':
- step:
name: Deploying to Dev
deployment: dev
script:
- git branch
- pipe: docker://<pipe_name>
variables:
NAMESPACE: $NAMESPACE
BUILD_HELM: $BUILD_HELM
- step:
name: Send Slack
script:
- declare -x VERSION=$(cat version.txt)
- pipe: atlassian/slack-notify:0.3.2
variables:
WEBHOOK_URL: $SLACK_URL
MESSAGE: "Deployed from Pipeline to env:DEV project:${PROJECT} version:${VERSION} "