DevSensei | Code Owners for Bitbucket

Workflows

  • πŸ”° fundamental topics for beginners getting started with DevSensei

  • πŸ”¬ advanced topics for once you have your first workflows automated

A devsensei.yaml file has a top-level workflows property, which declares a list of Workflow objects. (Review the workflow concept).

Example

YAML
workflows:
  - name: Check commits
    merge-checks:
    # ...
  - name: Make Checklist
    actions:
    # ...

Workflow Properties

Attribute

Definition

name (required) πŸ”°

The name of the workflow. Must be unique in a repository.

conditions (optional) πŸ”°

A set of conditions to be met for the actions of the workflow to be executed for a pull request. If empty then all pull requests will match.

retrigger-on (optional) πŸ”¬

A set of expressions. Causes additional trigger for actions each time the value changes while the condition is currently met.

YAML
retrigger-on:
  # on change to an attribute's value
  - destination
  # on a change to the contents of the PR's diff.
  - diff-change

actions (optional) πŸ”°

A set of actions to be executed each time the conditions are met for a pull request, or when a value in the retrigger-on list changes while the conditions are met.

merge-checks (optional) πŸ”°

A set of rules that are continuously checked. If any rule fails to pass then the PR is prevented from merging.

custom-attributes (optional) πŸ”°

A set of custom attributes that can be used within actions and merge-checks. They can for example be used to define user groups or Code Owners in the workflow.

overrides (optional) πŸ”¬

A workflow with the same name can be overridden in the main devsensei.yaml file. If so, the workflow object must have overrides=true. If not, then you will get a validation error for the duplicate names.

main.yaml

YAML
includes:
  - other.yaml
workflows:
  # overriding included workflow
  - name: I am overridden
    overrides: true

other.yaml

YAML
workflows:
  # original definition of workflow
  - name: I am overridden
    conditions: #...
    actions: #...

ignore-directory-scope (optional, only relevant with directory includes) πŸ”¬

SINCE 9.8

By default, workflows included via the special directory include don’t run if no files are modified within.

Set this flag to true to overrule that behaviour.