label-pullrequest.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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@2541b1294d2704b0964813337f33b291d3f8596b # v3
  14. with:
  15. persist-credentials: false
  16. - name: Check for file changes
  17. uses: getsentry/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126 # master
  18. id: changes
  19. with:
  20. token: ${{ github.token }}
  21. filters: .github/file-filters.yml
  22. - name: Add frontend label
  23. uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
  24. if: steps.changes.outputs.frontend_src == 'true'
  25. with:
  26. labels: 'Scope: Frontend'
  27. - name: Add backend label
  28. uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
  29. if: steps.changes.outputs.backend_src == 'true'
  30. with:
  31. labels: 'Scope: Backend'
  32. - name: Find previous frontend/backend warning comment
  33. uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
  34. id: fc
  35. with:
  36. issue-number: ${{ github.event.pull_request.number }}
  37. comment-author: 'github-actions[bot]'
  38. body-includes: '<!-- FRONTEND_BACKEND_WARNING -->'
  39. - name: Add frontend/backend warning comment
  40. uses: peter-evans/create-or-update-comment@b95e16d2859ad843a14218d1028da5b2c4cbc4b4
  41. if: >
  42. steps.changes.outputs.frontend_src == 'true' &&
  43. steps.changes.outputs.backend_src == 'true' &&
  44. steps.fc.outputs.comment-id == 0
  45. with:
  46. issue-number: ${{ github.event.pull_request.number }}
  47. body: >
  48. <!-- FRONTEND_BACKEND_WARNING -->
  49. 🚨 **Warning:** This pull request contains Frontend and Backend changes!
  50. It's discouraged to make changes to Sentry's Frontend and Backend
  51. in a single pull request. The Frontend and Backend are **not**
  52. atomically deployed. If the changes are interdependent of each
  53. other, they **must** be separated into two pull requests and be made
  54. forward or backwards compatible, such that the Backend or Frontend
  55. can be safely deployed independently.
  56. Have questions? Please ask in the [`#discuss-dev-infra`
  57. channel](https://app.slack.com/client/T024ZCV9U/CTJL7358X).