label-pullrequest.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Adds labels to pull requests for the type of change the PR makes
  2. name: meta(labels)
  3. on:
  4. pull_request_target:
  5. jobs:
  6. label-pullrequest:
  7. permissions:
  8. contents: read
  9. pull-requests: write
  10. name: labels pull requests (frontend / backend)
  11. runs-on: ubuntu-20.04
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Check for file changes
  15. uses: getsentry/paths-filter@master
  16. id: changes
  17. with:
  18. token: ${{ github.token }}
  19. filters: .github/file-filters.yml
  20. - name: Add frontend label
  21. uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
  22. if: steps.changes.outputs.frontend == 'true'
  23. with:
  24. labels: frontend
  25. - name: Add backend label
  26. uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
  27. if: steps.changes.outputs.backend == 'true'
  28. with:
  29. labels: backend
  30. - name: Find previous frontend/backend warning comment
  31. uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
  32. id: fc
  33. with:
  34. issue-number: ${{ github.event.pull_request.number }}
  35. comment-author: 'github-actions[bot]'
  36. body-includes: '<!-- FRONTEND_BACKEND_WARNING -->'
  37. - name: Add frontend/backend warning comment
  38. uses: peter-evans/create-or-update-comment@b95e16d2859ad843a14218d1028da5b2c4cbc4b4
  39. if: >
  40. steps.changes.outputs.frontend == 'true' &&
  41. steps.changes.outputs.backend == 'true' &&
  42. steps.fc.outputs.comment-id == 0
  43. with:
  44. issue-number: ${{ github.event.pull_request.number }}
  45. body: >
  46. <!-- FRONTEND_BACKEND_WARNING -->
  47. 🚨 **Warning:** This pull request contains Frontend and Backend changes!
  48. It's discouraged to make changes to Sentry's Frontend and Backend
  49. in a single pull request. The Frontend and Backend are **not**
  50. atomically deployed. If the changes are interdependent of each
  51. other, they **must** be separated into two pull requests and be made
  52. forward or backwards compatible, such that the Backend or Frontend
  53. can be safely deployed independently.
  54. Have questions? Please ask in the [`#discuss-dev-infra`
  55. channel](https://app.slack.com/client/T024ZCV9U/CTJL7358X).