Skip to content

Commit f20266f

Browse files
committed
docs: update README with new 'merge_request.modified_files_list' func
1 parent bae50e6 commit f20266f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

README.md

+8-10
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,10 @@ label:
187187
color: "$pink"
188188
# From this script, returning a list of labels
189189
script: >
190-
map(merge_request.diff_stats, { .path }) // Generate a list of all file paths that was changed in the Merge Request
191-
| filter({ hasPrefix(#, "pkg/service/") }) // Remove all paths that doesn't start with "pkg/service/"
192-
| map({ filepath_dir(#) }) // Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
193-
| map({ trimPrefix(#, "pkg/") }) // Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
194-
| uniq() // Remove duplicate values from the output
190+
merge_request.modified_files_list("pkg/service/") // Generate a list of all file paths that was changed in the Merge Request inside pkg/service/
191+
| map({ filepath_dir(#) }) // Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
192+
| map({ trimPrefix(#, "pkg/") }) // Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
193+
| uniq() // Remove duplicate values from the output
195194
```
196195

197196
### `label` (list)
@@ -301,11 +300,10 @@ label:
301300
description: "Modified this service directory"
302301
color: "$pink"
303302
script: >
304-
map(merge_request.diff_stats, { .path }) // Generate a list of all file paths that was changed in the Merge Request
305-
| filter({ hasPrefix(#, "pkg/service/") }) // Remove all paths that doesn't start with "pkg/service/"
306-
| map({ filepath_dir(#) }) // Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
307-
| map({ trimPrefix(#, "pkg/") }) // Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
308-
| uniq() // Remove duplicate values from the output
303+
merge_request.modified_files_list("pkg/service/") // Generate a list of all file paths that was changed in the Merge Request inside pkg/service/
304+
| map({ filepath_dir(#) }) // Remove the filename from the path "pkg/service/example/file.go" => "pkg/service/example"
305+
| map({ trimPrefix(#, "pkg/") }) // Remove the prefix "pkg/" from the path "pkg/service/example" => "service/example"
306+
| uniq() // Remove duplicate values from the output
309307
```
310308

311309
#### `label.color` (required)

0 commit comments

Comments
 (0)