Skip to content

Commit 5a60fbf

Browse files
authored
Sync eng/common directory with azure-sdk-tools repository for Tools PR Azure/azure-sdk-tools#902 (#13230)
1 parent 4950aa9 commit 5a60fbf

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
. (Join-Path $PSScriptRoot common.ps1)
32
Install-Module -Name powershell-yaml -RequiredVersion 0.4.1 -Force -Scope CurrentUser
4-
$ymlfiles = Get-ChildItem $RepoRoot | Where-Object {$_ -like '*.yml'}
5-
$affectedRepos = @()
3+
$ymlfiles = Get-ChildItem $RepoRoot -recurse | Where-Object {$_ -like '*.yml'}
4+
$affectedRepos = [System.Collections.ArrayList]::new()
65

76
foreach ($file in $ymlfiles)
87
{
@@ -21,7 +20,7 @@ foreach ($file in $ymlfiles)
2120
if (-not ($repo.Contains("ref")))
2221
{
2322
$errorMessage = "File: ${file}, Repository: ${repoName}."
24-
$affectedRepos.Add($errorMessage)
23+
[void]$affectedRepos.Add($errorMessage)
2524
}
2625
}
2726
}
@@ -30,14 +29,14 @@ foreach ($file in $ymlfiles)
3029

3130
if ($affectedRepos.Count -gt 0)
3231
{
33-
Write-Error "Ref not found in the following Repository Resources."
32+
Write-Output "Ref not found in the following Repository Resources."
3433
foreach ($errorMessage in $affectedRepos)
3534
{
36-
Write-Information $errorMessage
35+
Write-Output "`t$errorMessage"
3736
}
38-
Write-Information "Please ensure you add a Ref: when using repository resources"
39-
Write-Information "More Info at https://aka.ms/azsdk/engsys/tools-versioning"
37+
Write-Output "Please ensure you add a Ref: when using repository resources"
38+
Write-Output "More Info at https://aka.ms/azsdk/engsys/tools-versioning"
4039
exit 1
4140
}
4241

43-
Write-Information "All repository resources in yaml files reference a valid tag"
42+
Write-Output "All repository resources in yaml files reference a valid tag"

0 commit comments

Comments
 (0)