You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+48-12
Original file line number
Diff line number
Diff line change
@@ -207,13 +207,49 @@ label:
207
207
| uniq()
208
208
```
209
209
210
-
### `label` (list)
210
+
### `actions[]` (list)
211
+
212
+
The `actions` key is a list of actions that can be taken on a Merge Request.
213
+
214
+
#### `actions[].name`
215
+
216
+
The name of the action, this is purely for debugging and your convenience. It's encouraged to be descriptive of the actions.
217
+
218
+
#### `actions[].if`
219
+
220
+
A key controlling if the action should executed or not.
221
+
222
+
The `if` field must be a valid [Expr-lang](https://expr-lang.org/) expression returning a boolean.
223
+
224
+
#### `actions[].then[]` (list)
225
+
226
+
The list of operations to take if the `action.if` returned `true`.
227
+
228
+
#### `actions[].then[].action`
229
+
230
+
This key controls what kind of action that should be taken.
231
+
232
+
- `close`to close the Merge Request.
233
+
- `reopen`to reopen the Merge Request.
234
+
- `lock_discussion`to prevent further discussions on the Merge Request.
235
+
- `unlock_discussion`to allow discussions on the Merge Request.
236
+
- `approve`to approve the Merge Request.
237
+
- `unapprove`to approve the Merge Request.
238
+
- `comment`to add a comment to the Merge Request (requires the `message` field)
239
+
240
+
#### `actions[].then[].message`
241
+
242
+
Required field for `action: comment`.
243
+
244
+
The message that will be commented on the Merge Request.
245
+
246
+
### `label[]` (list)
211
247
212
248
The `label` key is a list of the labels you want to manage.
213
249
214
250
These keys are shared between the `conditional` and `generate` label strategy. (more above these below!)
215
251
216
-
#### `label.name`
252
+
#### `label[].name`
217
253
218
254
- When using `label.strategy: conditional`
219
255
@@ -223,7 +259,7 @@ These keys are shared between the `conditional` and `generate` label strategy. (
223
259
224
260
**OMITTED** The `name` field must not be set when using the `generate` strategy.
225
261
226
-
#### `label.script` (required)
262
+
#### `label[].script` (required)
227
263
228
264
> [!TIP]
229
265
> See the [SCM engine expr-lang documentation](#expr-lang-information) for more information about [functions](#functions) and [attributes](#attributes) available.
@@ -232,7 +268,7 @@ The `script` field is an [expr-lang](https://expr-lang.org/) expression, a safe,
232
268
233
269
Depending on the `label.strategy` used, the behavior of the script changes, read more about this below.
234
270
235
-
#### `label.strategy` (optional)
271
+
#### `label[].strategy` (optional)
236
272
237
273
SCM Engine supports two strategies for managing labels, each changes the behavior of the `script`.
238
274
@@ -244,11 +280,11 @@ SCM Engine supports two strategies for managing labels, each changes the behavio
244
280
245
281
The `script` must return a `list of strings`, where each label returned will be added to the Merge Request.
246
282
247
-
##### `label.strategy: conditional` use-cases
283
+
##### `label[].strategy: conditional` use-cases
248
284
249
285
Use the `conditional` strategy when you want to add/remove a label on a Merge Request depending on _something_. It's the default strategy, and the most simple one to use.
250
286
251
-
##### `label.strategy: conditional` examples
287
+
##### `label[].strategy: conditional` examples
252
288
253
289
> [!NOTE]
254
290
> The `script` field is a [expr-lang](https://expr-lang.org/) expression, a safe, fast, and intuitive expression evaluator.
@@ -283,11 +319,11 @@ label:
283
319
script: merge_request.modified_files("*_test.go")
284
320
```
285
321
286
-
##### `label.strategy: generate` use-cases
322
+
##### `label[].strategy: generate` use-cases
287
323
288
324
Use the `generate` strategy if you want to manage dynamic labels, for example, depending on the file structure within your project.
289
325
290
-
##### `label.strategy: generate` examples
326
+
##### `label[].strategy: generate` examples
291
327
292
328
> The `script` field is a [expr-lang](https://expr-lang.org/) expression, a safe, fast, and intuitive expression evaluator.
293
329
@@ -327,7 +363,7 @@ label:
327
363
| uniq()
328
364
```
329
365
330
-
#### `label.color` (required)
366
+
#### `label[].color` (required)
331
367
332
368
> [!NOTE]
333
369
> When used on `strategy: generate` labels, all generated labels will have the same color.
@@ -336,7 +372,7 @@ label:
336
372
337
373
You can either provide your own `#hex` value or use the [Twitter Bootstrap color variables](https://getbootstrap.com/docs/5.3/customize/color/#all-colors), for example `$blue-500` and `$teal`.
338
374
339
-
#### `label.description` (optional)
375
+
#### `label[].description` (optional)
340
376
341
377
> [!NOTE]
342
378
> When used on `strategy: generate` labels, all generated labels will have the same description.
@@ -345,14 +381,14 @@ An optional key that control the `description` field for the label within GitLab
345
381
346
382
Descriptions are shown in the User Interface when you hover any label.
347
383
348
-
#### `label.priority` (optional)
384
+
#### `label[].priority` (optional)
349
385
350
386
> [!NOTE]
351
387
> When used on `strategy: generate` labels, all generated labels will have the same priority.
352
388
353
389
An optional key that controls the [label `priority`](https://docs.gitlab.com/ee/user/project/labels.html#set-label-priority).
354
390
355
-
#### `label.skip_if` (optional)
391
+
#### `label[].skip_if` (optional)
356
392
357
393
An optional key controlling if the label should be skipped (meaning no removal or adding of labels).
0 commit comments