# These settings are synced to GitHub by https://probot.github.io/apps/settings/

repository:

  # Either `true` to make the repository private, or `false` to make it public.
  private: <% if(isPublic) { _%>false<%_ } else { _%>true<%_ } %>

  # Either `true` to enable issues for this repository, `false` to disable them.
  has_issues: <% if(isPublic) { _%>true<%_ } else { _%>false<%_ } %>

  # Either `true` to enable projects for this repository, or `false` to disable them.
  # If projects are disabled for the organization, passing `true` will cause an API error.
  has_projects: false

  # Either `true` to enable the wiki for this repository, `false` to disable it.
  has_wiki: false

  # Either `true` to enable downloads for this repository, `false` to disable them.
  has_downloads: <% if(isPublic) { _%>true<%_ } else { _%>false<%_ } %>

  # Updates the default branch for this repository.
  default_branch: develop

  # Either `true` to allow squash-merging pull requests, or `false` to prevent
  # squash-merging.
  allow_squash_merge: false

  # Either `true` to allow merging pull requests with a merge commit, or `false`
  # to prevent merging pull requests with merge commits.
  allow_merge_commit: false

  # Either `true` to allow rebase-merging pull requests, or `false` to prevent
  # rebase-merging.
  allow_rebase_merge: true

branches:
  # https://developer.github.com/v3/repos/branches/#update-branch-protection
  - name: master
    protection:
      required_pull_request_reviews:
        required_approving_review_count: 1
        dismiss_stale_reviews: true
        require_code_owner_reviews: true
        dismissal_restrictions:
          users: [ esg-bot ]
          teams: [ open-source ]
      required_status_checks:
        strict: true
        contexts: [ <% if(isPublic) { %>
          codeclimate/diff-coverage,
          codecov/project,
          continuous-integration/travis-ci,<%_ } %>
        ]
      enforce_admins: false
      restrictions:
        users: [ esg-bot ]
        teams: [ open-source ]
  # https://developer.github.com/v3/repos/branches/#update-branch-protection
  - name: develop
    protection:
      required_pull_request_reviews:
        required_approving_review_count: 1
        dismiss_stale_reviews: true
        require_code_owner_reviews: true
        dismissal_restrictions:
          users: [ esg-bot ]
          teams: [ open-source ]
      required_status_checks:
        strict: true
        contexts: [ <% if(isPublic) { %>
          codeclimate/diff-coverage,
          codecov/project,
          continuous-integration/travis-ci,<%_ } %>
        ]
      enforce_admins: false
      restrictions:
        users: [ esg-bot ]
        teams: [ open-source ]
