Branch name convention
  • Updated on 06 May 2019
  • 1 minute to read
  • Contributors
  • Share
  • Dark
    Light

Branch name convention

  • Share
  • Dark
    Light

This rule ensures the branch name includes a reference to an issue tracking system ticket.

Branches are linked automatically to your issue tracking system if the issue key included in the branch name (e.g. git branch โ€œfeatures/PROJECT-549โ€)

Use case(s)

  • Create a logical link between planning (tracking system) and the subsequent code change (Git)
  • Recommended requirement for SOC2 complaint

How to implement?

This policy will work only if implemented inside each CircleCi config file
Want to enforce this rule, with a single click, on the Git level? Check our built-in policy!
orbs:
  datree: datree/policy@latest
description: A circle-ci job to enforce Datree's branch name convention rule
jobs:
  my_job:
    docker:
      - image: 'circleci/node:10'
    steps:
      - datree/branch-name-convention:
          issue_tracker: jira
version: 2.1
workflows:
  main:
    jobs:
      - my_job
Extended version of this guide can be found on CircleCi Datree/Policy Orb documentation

When does this rule fail?

If there is no reference to (issue tracking system) ticket number in the branch name.

GitHub view:

Screen Shot 2019-05-06 at 15.18.27

CircleCi view:

Screen Shot 2019-05-06 at 15.19.36

How to fix?

Follow the instructions on this guide.

Was this article helpful?