-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
78 lines (68 loc) · 2.25 KB
/
request-reviews.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Assign reviews
on:
pull_request:
types: [opened, reopened, ready_for_review]
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest-low
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
continue-on-error: true
with:
filters: |
backend:
- '3rdparty/**'
- '**/appinfo/**'
- '**/lib/**'
- '**/templates/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'psalm*'
- 'build/psalm*'
- '**.php'
frontend:
- 'apps/*/src/**'
- 'core/src/**'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
assign-reviews:
name: Assign reviews
runs-on: ubuntu-latest-low
needs: changes
# Only if there are not already reviews requested
if: github.event.pull_request.requested_reviewers[1] == null
permissions:
pull-requests: write
steps:
- name: Assign backend engineers
if: needs.changes.outputs.backend == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers' \
-f "team_reviewers[]=server-backend"
- name: Assign frontend engineers
if: needs.changes.outputs.frontend == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers' \
-f "team_reviewers[]=server-frontend"