auto_assign_prs.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. toolchain:
  35. - 'toolchain/**'
  36. - id: assign-leads
  37. if: steps.filter.outputs.leads == 'true'
  38. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  39. with:
  40. reviewers: KateGregory, chandlerc, zygoloid
  41. max-num-of-reviewers: 1
  42. - id: assign-toolchain
  43. if: steps.filter.outputs.toolchain == 'true'
  44. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  45. with:
  46. reviewers:
  47. chandlerc, danakj, dwblaikie, geoffromer, jonmeow, josh11b, zygoloid
  48. max-num-of-reviewers: 1
  49. - id: assign-fallback
  50. if: |
  51. steps.filter.outputs.leads != 'true' &&
  52. steps.filter.outputs.toolchain != 'true'
  53. uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
  54. with:
  55. reviewers: chandlerc, danakj, jonmeow, josh11b, zygoloid
  56. max-num-of-reviewers: 1