Details
-
Suggestion
-
Resolution: Unresolved
-
None
Description
Currently, the Pipelines step name is not part of the default Pipelines environment variables.
Enhancement request:
It would be helpful to include the step name as a default variable.
Workaround:
As a workaround, you can get the current step name using an API endpoint and save it as an environment variable.
image: atlassian/default-image:4 pipelines: default: - step: name: "Some Step Name" script: - BB_STEP_NAME=$(curl --request GET --url "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_FULL_NAME}/pipelines/%7B${BITBUCKET_PIPELINE_UUID}%7D/steps/%7B${BITBUCKET_STEP_UUID}%7D?fields=name" -u $BITBUCKET_USERNAME:$BITBUCKET_APP_PASSWORD | jq -r '.name') - echo $BB_STEP_NAME