Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
b923c40e
Unverified
Commit
b923c40e
authored
5 months ago
by
Rhys Arkins
Committed by
GitHub
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(yaml): allow filtering of invalid multidoc (#31963)
parent
fbc3ba8d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/util/yaml.ts
+3
-3
3 additions, 3 deletions
lib/util/yaml.ts
with
3 additions
and
3 deletions
lib/util/yaml.ts
+
3
−
3
View file @
b923c40e
...
...
@@ -63,19 +63,19 @@ export function parseYaml<ResT = unknown>(
const
results
:
ResT
[]
=
[];
for
(
const
rawDocument
of
rawDocuments
)
{
const
document
=
rawDocument
.
toJS
({
maxAliasCount
:
10000
});
const
errors
=
rawDocument
.
errors
;
// handle YAML parse errors
if
(
errors
?.
length
)
{
const
error
=
new
AggregateError
(
errors
,
'
Failed to parse YAML file
'
);
if
(
options
?.
failureBehaviour
===
'
filter
'
)
{
logger
.
debug
(
{
error
,
document
},
'
Failed to parse YAML
'
);
logger
.
debug
(
`Failed to parse YAML file:
${
error
.
message
}
`
);
continue
;
}
throw
error
;
}
const
document
=
rawDocument
.
toJS
({
maxAliasCount
:
10000
});
// skip schema validation if no schema is provided
if
(
!
schema
)
{
results
.
push
(
document
as
ResT
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment