Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-23102

Include step name as default variable in Bitbucket Cloud Pipelines

XMLWordPrintable

    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      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
      

              Unassigned Unassigned
              mcerezo Mark C
              Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: