label_prs.yaml 1.8 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 label PRs'
  5. on:
  6. pull_request_target:
  7. types: [opened, ready_for_review]
  8. jobs:
  9. assign_reviewer:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - id: filter
  13. uses: dorny/paths-filter@v2
  14. with:
  15. filters: |
  16. documentation:
  17. - '*.md'
  18. - 'docs/**'
  19. explorer:
  20. - 'explorer/**'
  21. infrastructure:
  22. - 'BUILD'
  23. - 'WORKSPACE'
  24. - '.*'
  25. - '.*/**'
  26. - 'bazel/**'
  27. - 'scripts/**'
  28. toolchain:
  29. - 'toolchain/**'
  30. - id: documentation
  31. if: steps.filter.outputs.docs == 'true'
  32. run: |
  33. gh pr edit "${PR}" --add-label "documentation"
  34. env:
  35. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  36. PR: ${{ github.event.pull_request.html_url }}
  37. - id: explorer
  38. if: steps.filter.outputs.explorer == 'true'
  39. run: |
  40. gh pr edit "${PR}" --add-label "explorer"
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  43. PR: ${{ github.event.pull_request.html_url }}
  44. - id: infrastructure
  45. if: steps.filter.outputs.docs == 'true'
  46. run: |
  47. gh pr edit "${PR}" --add-label "infrastructure"
  48. env:
  49. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  50. PR: ${{ github.event.pull_request.html_url }}
  51. - id: toolchain
  52. if: steps.filter.outputs.toolchain == 'true'
  53. run: |
  54. gh pr edit "${PR}" --add-label "toolchain"
  55. env:
  56. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  57. PR: ${{ github.event.pull_request.html_url }}