Skip to content

Commit e23f297

Browse files
authored
Validate pipeline color as hex color format (#925)
1 parent 453d488 commit e23f297

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

buildkite/resource_pipeline.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ func (*pipelineResource) Schema(ctx context.Context, req resource.SchemaRequest,
479479
"color": schema.StringAttribute{
480480
Optional: true,
481481
MarkdownDescription: "A color hex code to represent this pipeline.",
482+
Validators: []validator.String{
483+
stringvalidator.RegexMatches(
484+
regexp.MustCompile(`^\#[a-zA-Z0-9]{6}$`),
485+
"must be a valid color hex code (#000000)",
486+
),
487+
},
482488
},
483489
"cluster_id": schema.StringAttribute{
484490
MarkdownDescription: "Attach this pipeline to the given cluster GraphQL ID.",

0 commit comments

Comments
 (0)