Skip to content

Commit 43b1ce8

Browse files
committed
docs: document merge_request.has_label
1 parent f1960ad commit 43b1ce8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,14 @@ The file patterns use the [`.gitignore` format](https://git-scm.com/docs/gitigno
471471
merge_request.modified_files("*.go", "docs/")
472472
```
473473

474+
#### `merge_request.has_label`
475+
476+
Returns wether any of the provided label exist on the Merge Request.
477+
478+
```expr
479+
merge_request.has_label("my-label-name")
480+
```
481+
474482
#### `duration`
475483

476484
Returns the [`time.Duration`](https://pkg.go.dev/time#Duration) value of the given string str.

schema/gitlab.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ func main() {
6666

6767
func nest(props []*Property) {
6868
for _, field := range props {
69-
7069
if field.IsCustomType {
7170
for _, nested := range PropMap[field.Type].Attributes {
7271
field.AddAttribute(&Property{
@@ -175,6 +174,7 @@ func mutateHook(b *modelgen.ModelBuild) *modelgen.ModelBuild {
175174
fieldProperty := &Property{
176175
Name: exprTags.Name,
177176
Optional: field.Omittable || strings.HasPrefix(fieldType, "*"),
177+
IsSlice: strings.HasPrefix(fieldType, "[]"),
178178
Description: field.Description,
179179
}
180180

@@ -196,7 +196,6 @@ func mutateHook(b *modelgen.ModelBuild) *modelgen.ModelBuild {
196196
}
197197

198198
fieldProperty.Type = strings.TrimPrefix(fieldType, "*")
199-
fieldProperty.IsSlice = strings.HasPrefix(fieldType, "[]") || fieldType == "label"
200199

201200
modelProperty.AddAttribute(fieldProperty)
202201
} // end expr tag is set

0 commit comments

Comments
 (0)