auto_assign_prs.yaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. name: 'Auto assign PRs'
  5. on:
  6. pull_request_target:
  7. types: [opened, ready_for_review]
  8. permissions:
  9. pull-requests: write # For gh to edit assignees.
  10. jobs:
  11. assign_reviewer:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Harden Runner
  15. uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
  16. with:
  17. disable-sudo: true
  18. egress-policy: block
  19. # prettier-ignore
  20. allowed-endpoints: >
  21. api.github.com:443
  22. - id: filter
  23. uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  24. with:
  25. filters: |
  26. leads:
  27. - '*.md'
  28. - 'LICENSE'
  29. - 'docs/project/principles/*'
  30. - 'docs/project/evolution.md'
  31. - 'docs/project/goals.md'
  32. - 'docs/project/roadmap.md'
  33. - 'proposals/*.md'
  34. explorer:
  35. - 'explorer/**'
  36. toolchain:
  37. - 'toolchain/**'
  38. - id: assign-leads
  39. if: steps.filter.outputs.leads == 'true'
  40. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  41. with:
  42. reviewers: KateGregory, chandlerc, zygoloid
  43. max-num-of-reviewers: 1
  44. - id: assign-explorer
  45. if: steps.filter.outputs.explorer == 'true'
  46. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  47. with:
  48. reviewers: geoffromer, jonmeow, zygoloid
  49. max-num-of-reviewers: 1
  50. - id: assign-toolchain
  51. if: steps.filter.outputs.toolchain == 'true'
  52. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  53. with:
  54. reviewers:
  55. chandlerc, danakj, dwblaikie, geoffromer, jonmeow, josh11b, zygoloid
  56. max-num-of-reviewers: 1
  57. - id: assign-fallback
  58. if: |
  59. steps.filter.outputs.leads != 'true' &&
  60. steps.filter.outputs.explorer != 'true' &&
  61. steps.filter.outputs.toolchain != 'true'
  62. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  63. with:
  64. reviewers: chandlerc, danakj, jonmeow, josh11b, zygoloid
  65. max-num-of-reviewers: 1