Bitbucket Pipelines Validator.

Paste your bitbucket-pipelines.yml and press Validate. Every step is checked against the Bitbucket Pipelines schema before you push and wait for a build to fail.

What it checks

Steps, pipelines and definitions against the schema

The validator recognizes a Bitbucket file by its top-level pipelines key and checks it against the Bitbucket Pipelines JSON Schema from SchemaStore. Errors give the path to the value, such as /pipelines/default/0/step/size, and the editor marks the line.

  • Every step: in the default pipeline, in branch, tag, pull-request and custom pipelines, and inside parallel groups and stages. A step in a parallel group is reported as …/parallel/0/step/….
  • Allowed values: size, trigger, clone.depth, and the service type.
  • Lists and numbers: script, after-script, caches and services must be lists; max-time and service memory must be plain integers.
  • Conditions and custom pipeline variables: field names under condition.changesets, and a name for each variable.

YAML syntax is checked first, so a bad indent is reported with its line before the schema runs. Everything runs in your browser; the file is never uploaded.

Common mistakes

What the validator catches, with the message you get

A script as one line of text

- step:
    name: Test
    script: npm ci && npm test

Message: /pipelines/default/0/step/script must be array. A script is a list of commands, even when there is only one. Write it as script: with - npm ci and - npm test on their own lines. The same applies to after-script, caches and services.

A step size that does not exist

- step:
    size: 3x

Message: /pipelines/default/0/step/size must be one of: 1x, 2x, 4x, 8x, 16x, 32x. Sizes double; there is no 3x.

trigger: auto

- step:
    name: Deploy
    trigger: auto

Message: /pipelines/default/0/step/trigger must be one of: automatic, manual. Leave trigger out for a step that runs on its own, or write manual for one you start by hand.

A unit on max-time

- step:
    max-time: 30m

Message: /pipelines/default/0/step/max-time must be integer. The value is a number of minutes: max-time: 30.

A unit on service memory

definitions:
  services:
    docker:
      memory: 3GB

Message: /definitions/services/docker/memory must be integer. Memory is in megabytes: memory: 3072. Values under 128 are reported too.

A typo in a changeset condition

- step:
    condition:
      changesets:
        includePath:
          - src/**

Message: /pipelines/default/0/step/condition/changesets unknown property 'includePath'. The keys are includePaths and excludePaths, plural.

Limits

What a schema check cannot tell you

  • A misspelled top-level key: the schema does not require pipelines and allows unknown keys at the top, so pipeline: instead of pipelines: passes.
  • Misspelled keys in a step are not reported. A step with scripts: instead of script: passes, and so does a step with no script at all. The same goes for a pipeline type like pull-request: instead of pull-requests:.
  • Names that point elsewhere: a cache or service name in a step is not looked up in definitions or in the built-in caches, so a typo like nodee passes.
  • Variables such as $AWS_ACCESS_KEY_ID are plain text here. Whether a repository, workspace or deployment variable is defined is known only to Bitbucket.
  • Pipes: the check makes sure a pipe has a pipe: name and that its variables are strings or lists. Which variables a pipe needs, and their values, are defined by the pipe itself.
  • Your workspace: whether a step size, a runner label in runs-on or a deployment environment is available to your repository and plan.
Validate other YAML files