In this page

Overview

This page is a collection of techniques that you can use on the YAML-format commit policy configuration file.

Indenting nested parameter keys in YAML

When indenting nested parameter keys, always use "space" characters (recommended to use two "spaces"). Using "tabs" will result in check errors.

foo:
  bar:
    baz: All lines are indented with spaces.

Multi-line texts in YAML

If you have a longer piece of text that you don't want to enter to a single line, break that to multiple lines like below.

body: >-
  This piece of text
  spans three lines
  in YAML.

Use a YAML validator

If your YAML breaks the configuration, you can find the problematic field or value faster with this online YAML validator.

Use a regex validator

Regular expressions (regex) are powerful for matching patterns in text. If you are new to regex, you can begin here:

  1. Regex tutorial (quick cheatsheet by examples)
  2. RegexOne (interactive exercises)
  3. Regular expression (Wikipedia article) (thorough but dense for a first read)

Regex comes in several dialects. Better Commit Policy Connector for Bitbucket relies on the Java-style dialect. To be sure your expressions work as expected, test and validate them with RegexPlanet.

Questions?

Ask us any time.