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