pull_request_rules:
  - name: automatic approve dependabot pull requests
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - status-success=Travis CI - Pull Request
      - status-success=continuous-integration.azure-devops
    actions:
      review:
        type: APPROVE

  # For salt-formula or pyinstaller updates, trigger codebuild, merge on codebuild status
  - name: write issue comment to start codebuild job
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - and:
          - "#approved-reviews-by>=1"
          - or:
            - label=submodules
            - title~=(?i).*pyinstaller.*
    actions:
      comment:
        message: go codebuild go

  - name: automatic merge for dependabot pull requests
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - or:
          - label=submodules
          - title~=(?i).*pyinstaller.*
      - status-success=codebuild/custom/pr
      - status-success=codebuild/default/pr
      - "#approved-reviews-by>=1"
    actions:
      merge:
        method: merge

  # For regular dependabot pr, automatically merge on approve
  - name: automatic merge for dependabot pull requests
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - "#approved-reviews-by>=1"
      - label!=submodules
      - not:
        - title~=(?i).*pyinstaller.*
    actions:
      merge:
        method: merge

pull_request_rules:
  - name: automatic approve dependabot pull requests
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - status-success=Travis CI - Pull Request
      - status-success=continuous-integration.azure-devops
    actions:
      review:
        type: APPROVE

  # For salt-formula or pyinstaller updates, trigger codebuild, merge on codebuild status
  - name: write issue comment to start codebuild job
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - and:
          - "#approved-reviews-by>=1"
          - or:
            - label=submodules
            - title~=(?i).*pyinstaller.*
    actions:
      comment:
        message: go codebuild go

  - name: automatic merge for dependabot submodule or pyinstaller pull requests with approval and codebuild success 
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - or:
          - label=submodules
          - title~=(?i).*pyinstaller.*
      - status-success=codebuild/custom/pr
      - status-success=codebuild/default/pr
      - "#approved-reviews-by>=1"
    actions:
      merge:
        method: merge

  # For regular dependabot pr, automatically merge on approve
  - name: automatic merge for dependabot pull requests that are not pyinstaller and not submodules
    conditions:
      - author~=dependabot\[bot\]|dependabot-preview\[bot\]
      - "#approved-reviews-by>=1"
      - label!=submodules
      - not:
        - title~=(?i).*pyinstaller.*
    actions:
      merge:
        method: merge

Update rule names to be unique
Update rule names to be unique
