Sync eng/common directory with azure-sdk-tools for PR 3568 (#3804)

* Skip yml files for which parsing failed

* Update eng/common/scripts/Verify-Resource-Ref.ps1

Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2022-07-06 14:00:13 -07:00 committed by GitHub
parent b59bc3628b
commit 0456c58298
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,16 @@ foreach ($file in $ymlfiles)
{
Write-Host "Verifying '${file}'"
$ymlContent = Get-Content $file.FullName -Raw
$ymlObject = ConvertFrom-Yaml $ymlContent -Ordered
try
{
$ymlObject = ConvertFrom-Yaml $ymlContent -Ordered
}
catch
{
Write-Host "Skipping $($file.FullName) because the file does not contain valid yml."
continue
}
if ($ymlObject -and ($ymlObject.Contains("resources")))
{