Skip to content

Instantly share code, notes, and snippets.

@jadb
Last active August 11, 2016 00:07
Show Gist options
  • Save jadb/48431d5d77fdf39145131897c6f75386 to your computer and use it in GitHub Desktop.
Save jadb/48431d5d77fdf39145131897c6f75386 to your computer and use it in GitHub Desktop.
Enforce Awesome Lists Contribution Guidelines
ruleset:
one_suggestion:
name: "a single suggestion / PR"
events: [ pull_request ]
message: >
@{{ user.login }}, please only add one suggestion per PR.
when:
- action = "opened" or action = "reopened"
- additions > 1
- files has "README.md"
require_url:
name: "the line contains a URL"
events: [ pull_request ]
message: >
@{{ user.login }}, suggestions should contain links.
when:
- action = "opened" or action = "reopened"
- count(diff_links.added) = 0
- files has "README.md"
broken_links:
name: "the URL is accessible (200 status code)"
events: [ pull_request ]
message: >
@{{ user.login }}, the link for your suggestion (in the diff) did not return
an HTTP status code of 200. Please check for broken links and/or redirects.
The broken link is: {{ diff_links.broken.0 }}
when:
- action = "opened" or action = "reopened"
- count(diff_links.broken) > 0
- files has "README.md"
link_in_description:
name: "the URL matches the URL in the PR's body"
events: [ pull_request ]
comment: >
@{{ user.login }}, please include links you added in the diff
directly to the pull request body also to make it easier to check, thanks.
when:
- action = "opened" or action = "reopened"
- not(body_links.added contains diff_links.added)
- files has "README.md"
minimum_length:
name: "and the PR body has a minimum length of X"
events: [ pull_request ]
close: true
label: invalid
comment: >
@{{ user.login }}, the pull request body should be longer than 50 characters.
when:
- action = "opened" or action = "reopened"
- length(body) < 50
- files has "README.md"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment