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

bitbucket-pipelines.yml validator should correctly handle the bash test command

    XMLWordPrintable

    Details

      Description

      Problem

      The Bitbucket bitbucket-pipelines.yml validator is not properly validating a command if it starts with the bash test command ”[[ expression ]]”.

      Steps to reproduce

      Create a a pipeline with a test like shown in the image above

      Workaround

      Wrap up the test command with an IF command like described below.

      The command:

      {{[ $BITBUCKET_BRANCH =~ [A-Z][a-z]+-[0-9]

      {2,} ] && export BRANCH = $BASH_REMATCH[0]}}

      Will become:

      {{if [ $BITBUCKET_BRANCH =~ [A-Z][a-z]+-[0-9]{2,}

      ]; then export BRANCH = $BASH_REMATCH[0]; fi}}

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            dsantos Daniel Santos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: