pull_request_rules:
  - name: Test passed for code changed
    conditions:
      - or:
        - base=master
        - base~=2\.\d
      - "status-success=Build and test"
    actions:
      label:
        add:
          - ci-passed

  - name: Remove ci-passed when code check failed
    conditions:
      - or:
        - base=master
        - base~=2\.\d
      - "check-failure=Build and test"
    actions:
      label:
        remove:
          - ci-passed
