Skip to content

Commit

Permalink
fix: codesamples validation
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-crumbaugh committed Jun 11, 2024
1 parent 1e01176 commit ff46971
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions workflow/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ func (t Target) Validate(supportedLangs []string, sources map[string]Source) err
}

if t.CodeSamples != nil {
ext := filepath.Ext(t.CodeSamples.Output)
if !slices.Contains([]string{".yaml", ".yml"}, ext) {
return fmt.Errorf("failed to validate target: code samples output must be a yaml file")
// Output only needed if registry location is unset
if t.CodeSamples.Registry == nil {
ext := filepath.Ext(t.CodeSamples.Output)
if !slices.Contains([]string{".yaml", ".yml"}, ext) {
return fmt.Errorf("failed to validate target: code samples output must be a yaml file")
}
}
}

Expand Down

0 comments on commit ff46971

Please sign in to comment.