Skip to content

Commit

Permalink
Merge branch 'ms-zhenhua/armstrong-validation' of https://github.com/…
Browse files Browse the repository at this point in the history
…Azure/azure-rest-api-specs into ms-zhenhua/armstrong-validation-test
  • Loading branch information
ms-zhenhua committed Nov 29, 2024
2 parents a72d766 + 26726e3 commit d4a04b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions eng/scripts/Armstrong-Validation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ function Validate-Terraform-Error($repoPath, $filePath) {
function Get-AddedSwaggerFiles() {
$addedFiles = git -c core.quotepath=off diff --name-status --diff-filter=d $BaseCommitish $TargetCommitish | Where-Object { $_ -match 'A\s' } | ForEach-Object { $_.Substring(2).Trim() }
$addedSwaggerFiles = $addedFiles.Where({
$_.EndsWith(".json")
})
$_ -match "\d{4}-\d{2}-\d{2}(-preview)?/[^/]*\.json$"
})

return $addedSwaggerFiles
}
Expand All @@ -112,9 +112,9 @@ foreach ($file in $addedSwaggerFiles) {
$swaggerFilesToBeTest += $file

$terraformFiles = $filesToCheck.Where({
# since `git diff` returns paths with `/`, use the following code to match the `main.tf`
$_.StartsWith($directory)
})
# since `git diff` returns paths with `/`, use the following code to match the `main.tf`
$_.StartsWith($directory)
})

if ($terraformFiles.Count -eq 0) {
LogError "The new swagger file $file does not have Armstrong Configurations"
Expand Down

0 comments on commit d4a04b5

Please sign in to comment.