123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- # Adds labels to pull requests for the type of change the PR makes
- name: meta(labels)
- on:
- pull_request_target:
- jobs:
- label-pullrequest:
- permissions:
- contents: read
- pull-requests: write
- name: labels pull requests (frontend / backend)
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
- with:
- persist-credentials: false
- - name: Check for file changes
- uses: getsentry/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126 # master
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-filters.yml
- - name: Add frontend label
- uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
- if: steps.changes.outputs.frontend == 'true'
- with:
- labels: 'Scope: Frontend'
- - name: Add backend label
- uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
- if: steps.changes.outputs.backend == 'true'
- with:
- labels: 'Scope: Backend'
- - name: Find previous frontend/backend warning comment
- uses: peter-evans/find-comment@1769778a0c5bd330272d749d12c036d65e70d39d
- id: fc
- with:
- issue-number: ${{ github.event.pull_request.number }}
- comment-author: 'github-actions[bot]'
- body-includes: '<!-- FRONTEND_BACKEND_WARNING -->'
- - name: Add frontend/backend warning comment
- uses: peter-evans/create-or-update-comment@b95e16d2859ad843a14218d1028da5b2c4cbc4b4
- if: >
- steps.changes.outputs.frontend == 'true' &&
- steps.changes.outputs.backend == 'true' &&
- steps.fc.outputs.comment-id == 0
- with:
- issue-number: ${{ github.event.pull_request.number }}
- body: >
- <!-- FRONTEND_BACKEND_WARNING -->
- 🚨 **Warning:** This pull request contains Frontend and Backend changes!
- It's discouraged to make changes to Sentry's Frontend and Backend
- in a single pull request. The Frontend and Backend are **not**
- atomically deployed. If the changes are interdependent of each
- other, they **must** be separated into two pull requests and be made
- forward or backwards compatible, such that the Backend or Frontend
- can be safely deployed independently.
- Have questions? Please ask in the [`#discuss-dev-infra`
- channel](https://app.slack.com/client/T024ZCV9U/CTJL7358X).
|