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

Provide an environment variable indicating whether the current branch is the main branch

    XMLWordPrintable

Details

    • 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.

    Description

      Pipelines have a set of default variables (listed [here|https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/)] which provide information to the build such as branch name, build number, etc.

       

      It would be nice to have a new default variable added that communicates whether the current branch is the main branch. We have a custom Pipe which has logic that depends on whether or not the current branch is the main branch. Currently, we just check whether BITBUCKET_BRANCH is set to "main" or "master" but this breaks if a repo has a non-traditionally named main branch).

       

      Please add a default variable (for example, BITBUCKET_IS_MAIN_BRANCH: "true"|"false") that contains this value. 

      Attachments

        Activity

          People

            Unassigned Unassigned
            scevallos Sebastian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: