@@ -6,6 +6,15 @@ name: Codeowners - Legal
6
6
7
7
on :
8
8
workflow_dispatch :
9
+ pull_request :
10
+ types :
11
+ - edited
12
+ - opened
13
+ - ready_for_review
14
+ - reopened
15
+ - synchronize
16
+ paths :
17
+ - ' content/**'
9
18
10
19
permissions :
11
20
contents : read
@@ -19,40 +28,31 @@ jobs:
19
28
github.event.pull_request.head.ref != 'repo-sync' }}
20
29
runs-on : ubuntu-latest
21
30
steps :
22
- - name : Get files changed
23
- uses : dorny/paths-filter@0bc4621a3135347011ad047f9ecf449bf72ce2bd
24
- id : filter
25
- with :
26
- # Base branch used to get changed files
27
- base : ' main'
28
-
29
- # Enables setting an output in the format in `${FILTER_NAME}_files
30
- # with the names of the matching files formatted as JSON array
31
- list-files : json
32
-
33
- # Returns list of changed files matching each filter
34
- filters : |
35
- rai:
36
- - 'content/**'
37
-
38
31
- name : Check out repo
39
32
uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
40
33
34
+ - name : Get changed files
35
+ id : changed-files
36
+ uses : tj-actions/changed-files@40526807ee1e208a1a8c1bbe6bd2d1b044ef6368 # v40.0.2
37
+ with :
38
+ files : ' content/**'
39
+ output_renamed_files_as_deleted_and_added : true
40
+
41
41
- name : Set up Node and dependencies
42
+ if : steps.changed-files.outputs.any_changed == 'true'
42
43
uses : ./.github/actions/node-npm-setup
43
44
44
45
- name : Check content type
46
+ if : steps.changed-files.outputs.any_changed == 'true'
45
47
id : checkContentType
46
48
run : npm run check-content-type
47
49
env :
48
- FILE_PATHS_CONTENT_TYPES : ${{ steps.filter.outputs.rai_files }}
50
+ # all_changed_files does not include deleted files
51
+ CHANGED_FILE_PATHS : ${{ steps.changed-files.outputs.all_changed_files }}
49
52
CONTENT_TYPE : ' rai'
50
- - name : Logging
51
- run : |
52
- echo ${{ steps.checkContentType.outputs.contentType }}
53
53
54
54
- name : Add Legal team as a reviewer
55
- if : ${{ steps.checkContentType.outputs.contentType == 'true' }}
55
+ if : steps.checkContentType.outputs.containsContentType == 'true'
56
56
env :
57
57
# The GH CLI uses a slightly different env name for
58
58
# the token than the GITHUB_TOKEN used by actions
0 commit comments