.github/mergeable.yml

Summary

Maintainability
Test Coverage
version: 2
mergeable: # see https://github.com/mergeability/mergeable
  - when: pull_request.opened, pull_request.assigned, pull_request.unassiged
    name: 'Attempt to assign author'
    validate:
      - do: assignee
        min:
          count: 1 # Should be assigned to somebody; if not, assign author
    pass:
      - do: checks
        status: 'success'
    fail:
      - do: assign
        assignees: [ '@author' ] # this is not assigning if author not a project member see mergeability/mergeable#359
      - do: checks
        status: 'success' # Supply the default actions, as if this passed.
        payload:
          title: 'Author assigned'
  - when: pull_request.opened
    name: 'Check for release note if help, java/src, jython, resources, xml, or web'
    validate:
      - do: changeset
        or:  # passes if no lib files or is a release note
          - and: 
            - must_exclude:
                regex: "^help/"
            - must_exclude:
                regex: "^java/src/"
            - must_exclude:
                regex: "^jython/"
            - must_exclude:
                regex: "^resources/"
            - must_exclude:
                regex: "^web/"
            - must_exclude:
                regex: "^xml/"
          - must_include:
              regex: "help/en/releasenotes/current-draft-note.shtml"
    pass:
      - do: checks
        status: 'success'
    fail:
      - do: comment
        payload:
          body: > 
            Thanks for the PR. Please consider adding a release note in the help/en/releasenotes/current-draft-note.shtml file.
      - do: checks
        status: 'success'
  - when: pull_request.opened
    name: 'Add label if any .properties file modified'
    validate:
      - do: changeset
        must_exclude:
          regex: '\.properties$'
    pass:
      - do: checks
        status: 'success'
    fail:
      - do: comment
        payload:
          body: > 
            Thanks for the PR. It includes changes to properties files, so the 'Needs L10N' label has been added"
      - do: labels
        labels: [ 'Needs L10N' ]
        mode: 'add'
      - do: checks
        status: 'success'
  - when: pull_request.opened
    name: 'Add label for documentation changes'
    validate:
      - do: changeset
        must_include:
          regex: '^help/en/((?!releasenotes).)*$'  # Require at least one help page not in releasenotes
    pass:
      - do: comment
        payload:
          body: > 
            This PR includes files in the help hierarchy so the 'Documentation' label has been added.  Other labels may also be applied."
      - do: labels
        labels: [ 'Documentation' ]
        mode: 'add'
      - do: checks
        status: 'success'        
    fail:
      - do: checks
        status: 'success'
  - when: pull_request.*, pull_request_review.*
    name: 'Allow merge after one day'
    validate:
      - do: age
        created_at:
          days: 1
          message: 'PR needs to be at least 1 day old in order to merge'
    pass:
      - do: checks
        status: 'success'
        payload:
          title: 'PR old enough'
          summary: 'PR over one day old, can be merged.'
      - do: labels
        labels: [ 'New PR' ]
        mode: 'delete'
    fail:
      - do: checks
        status: 'failure'
        payload:
          title: 'PR too young'
          summary: 'Waiting for the PR to be one day old.'
      - do: labels
        labels: [ 'New PR' ]
        mode: 'add'
  - when: pull_request.*, pull_request_review.*
    name: 'Approved after last commit, no changes requested'
    validate:
      - do: approvals
        min:
          count: 1 # Number of minimum reviewers. In this case 1.
          message: 'Must have at least one review.'
        block:
          changes_requested: true # If true, block all approvals when one of the reviewers gave 'changes_requested' review
          message: 'Merge blocked by request for changes.'
        #limit:
        #  teams: ['org/team_slug'] # when the option is present, only the approvals from the team members will count
        #  owners: true # Optional boolean. When true, the file .github/CODEOWNER is read and only owners approval will count