pull_request_rules:
  - name: Add make label if a Make file is modified
    conditions:
      - files~=(Makefile|\.mk)$
    actions:
      label:
        add:
          - make
  - name: Automatically backport to v4.1.x based on label
    conditions:
      - base=main
      - label=backport-v4.1.x
      - label!=backport-v4.0.x
      - label!=backport-v3.13.x
      - label!=backport-v3.12.x
    actions:
      backport:
        branches:
          - v4.1.x
        assignees:
          - "{{ author }}"
  - name: Automatically backport to v4.0.x based on label
    conditions:
      - base=v4.1.x
      - label=backport-v4.0.x
      - label!=backport-v3.13.x
      - label!=backport-v3.12.x
    actions:
      backport:
        branches:
          - v4.0.x
        assignees:
          - "{{ author }}"
  - name: Automatically backport to v4.1.x & v4.0.x based on label
    conditions:
      - base=main
      - label=backport-v4.1.x
      - label=backport-v4.0.x
    actions:
      backport:
        branches:
          - v4.1.x
        labels:
          - backport-v4.0.x
        assignees:
          - "{{ author }}"
  - name: Automatically backport to v3.13.x based on label
    conditions:
      - base=v4.0.x
      - label!=backport-v4.1.x
      - label=backport-v3.13.x
      - label!=backport-v3.12.x
    actions:
      backport:
        branches:
          - v3.13.x
        assignees:
          - "{{ author }}"
