policy:
  approval:
    - or:
      - approved by Blueprint team member
      - approved by Blueprint team lead
      - authored by Blueprint team lead
      - excavator only touched config files
      - bots updated package.json and lock files
  disapproval:
    requires:
      organizations: [ "palantir" ]

approval_rules:
  - name: approved by Blueprint team member
    options:
      allow_contributor: false
    requires:
      count: 1
      teams: [ "palantir/blueprint" ]

  - name: approved by Blueprint team lead
    options:
      allow_contributor: true
    requires:
      count: 1
      users: [ "adidahiya" ]

  - name: authored by Blueprint team lead
    requires:
      count: 0
    if:
      has_author_in:
        users: [ "adidahiya" ]
      has_valid_signatures_by_keys:
        key_ids: ["807851B18384352E"]

  - name: excavator only touched config files
    requires:
      count: 0
    if:
      has_author_in:
        users: [ "svc-excavator-bot" ]
      only_changed_files:
        paths:
          - "^\\..*.yml$"
          - "^\\.github/.*$"
      has_valid_signatures_by_keys:
        key_ids: ["C9AF124A484882E0"]

  - name: bots updated package.json and lock files
    requires:
      count: 0
    if:
      has_author_in:
        users:
        - "svc-excavator-bot"
        - "dependabot[bot]"
      only_changed_files:
        paths:
          - "^.*yarn.lock$"
          - "^.*package.json$"
      has_valid_signatures_by_keys:
        key_ids: ["C9AF124A484882E0"]
