You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ruleset:
  2. body_link:
  3. name: "Pull requests that add links should also include them in the body"
  4. events: [ pull_request ]
  5. when:
  6. - action = "opened"
  7. - files = ["README.md"]
  8. - deletions = 0
  9. - not (body_links.added contains diff_links.added)
  10. comment: |
  11. This pull request adds the following suggestion:
  12. {{ diff.added.0 }}
  13. broken_link:
  14. name: "Pull request diff contains broken links"
  15. events: [ pull_request ]
  16. when:
  17. - action = "opened"
  18. - count(diff_links.broken) > 0
  19. comment: >
  20. @{{ user.login }}, at least one of the links in the pull request diff was
  21. reported as broken:
  22. - {{ diff_links.broken.0 }}
  23. missing_link:
  24. name: "Suggestions should include a link"
  25. events: [ pull_request ]
  26. when:
  27. - action = "opened"
  28. - files = ["README.md"]
  29. - deletions = 0
  30. - additions = 1
  31. - count(grep("/^\* /", diff.added)) = 1
  32. - count(diff_links.added) != 1
  33. comment: >
  34. @{{ user.login }}, it looks like you have added a new suggestion to the
  35. `README.md` file but haven't linked to the project. Please update the
  36. `README.md` to also link to the project, thanks!
  37. multiple_additions:
  38. name: "Pull request should only suggest one addition at a time"
  39. events: [ pull_request ]
  40. comment: |
  41. @{{ user.login }}, it looks like you are trying to add multiple suggestions in a single pull request.
  42. If so, please split these into multiple pull requests so each item's inclusion in the list can be discussed separately.
  43. when:
  44. - action = "opened"
  45. - files = ["README.md"]
  46. - deletions = 0
  47. - count(grep("/^\* /", diff.added)) > 1
  48. needs_explanation:
  49. name: 'Pull request bodies should have a detailed explanation'
  50. events: [ pull_request ]
  51. label: 'needs: explanation'
  52. when:
  53. - action = "opened"
  54. - length(body) < 25
  55. message: >
  56. @{{ user.login }}, please update the pull request body with a description
  57. of what you are adding or changing (of at least 25 characters).