Include step name as default variable in Bitbucket Cloud Pipelines

XMLWordPrintable

    • 1

      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
      

              Assignee:
              Unassigned
              Reporter:
              Mark C
              Votes:
              9 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: