ruleset:
    broken_links:
        name:   "Check for broken links in README.md"
        events: [ pull_request ]
        message: >
            @{{ user.login }}, one of the links in the diff did not return an HTTP
            status code of 200. Please check for broken links. The first broken link
            is: {{ diff_links.broken.0 }}
        when:
            - action = "opened" or action = "reopened"
            - files has "README.md"
            - count(diff_links.broken) > 0

    description_too_short:
        name:   "Check length of description"
        events: [ issues ]
        when:   length(body) < 50
        reopen: true
        message: >
            @{{ user.login }}, the issue description is too short. Please reopen it
            once you have amended the description to contain more than the requirement
            of 50 characters.

    remove_label_invalid_on_reopen:
        name:   "Remove `invalid` label when issues/PRs are reopened"
        events: [ issues, pull_request ]
        label:  -invalid
        when:   action = "reopened"
