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.
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
parallelgroups and stages. A step in a parallel group is reported as…/parallel/0/step/…. - Allowed values:
size,trigger,clone.depth, and the servicetype. - Lists and numbers:
script,after-script,cachesandservicesmust be lists;max-timeand servicememorymust be plain integers. - Conditions and custom pipeline variables: field names under
condition.changesets, and anamefor 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.
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.
What a schema check cannot tell you
- A misspelled top-level key: the schema does not require
pipelinesand allows unknown keys at the top, sopipeline:instead ofpipelines:passes. - Misspelled keys in a step are not reported. A step with
scripts:instead ofscript:passes, and so does a step with noscriptat all. The same goes for a pipeline type likepull-request:instead ofpull-requests:. - Names that point elsewhere: a cache or service name in a step is not looked up in
definitionsor in the built-in caches, so a typo likenodeepasses. - Variables such as
$AWS_ACCESS_KEY_IDare 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-onor a deployment environment is available to your repository and plan.