Pipeline Conditions

Drone supports defining conditional pipelines to skip commits based on the target branch. If the branch matches the branches: block the pipeline is executed, otherwise it is skipped.

Example skipping a commit when the target branch is not master:

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

+branches: master

Example matching multiple target branches:

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

+branches: [ master, develop ]

Example uses glob matching:

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

+branches: [ master, feature/* ]

Example includes branches:

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

+branches:
+  include: [ master, feature/* ]

Example excludes branches:

pipeline:
  build:
    image: golang
    commands:
      - go build
      - go test

+branches:
+  exclude: [ develop, feature/* ]

Questions?

We are always happy to help with questions you might have. Search our documentation or check out answers to common questions. You can also post questions or comments to our community forum.

Is there a mistake on this page? Please let us know or edit this page.