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-22.04
  12. steps:
  13. - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
  14. with:
  15. persist-credentials: false
  16. - name: Check for file changes
  17. uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
  18. id: changes
  19. with:
  20. token: ${{ github.token }}
  21. filters: .github/file-filters.yml
  22. - name: Add frontend label
  23. uses: getsentry/action-add-labels@54d0cba498c1eaf8bd34985d715504d1b6e2935f
  24. if: steps.changes.outputs.frontend_src == 'true'
  25. with:
  26. labels: 'Scope: Frontend'
  27. - name: Add backend label
  28. uses: getsentry/action-add-labels@54d0cba498c1eaf8bd34985d715504d1b6e2935f
  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@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2.4.0
  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).