Skip to content

Commit 26726e3

Browse files
committed
bug fix
1 parent 3775e7e commit 26726e3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

eng/scripts/Armstrong-Validation.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ function Validate-Terraform-Error($repoPath, $filePath) {
8686
function Get-AddedSwaggerFiles() {
8787
$addedFiles = git -c core.quotepath=off diff --name-status --diff-filter=d $BaseCommitish $TargetCommitish | Where-Object { $_ -match 'A\s' } | ForEach-Object { $_.Substring(2).Trim() }
8888
$addedSwaggerFiles = $addedFiles.Where({
89-
$_.EndsWith(".json")
90-
})
89+
$_ -match "\d{4}-\d{2}-\d{2}(-preview)?/[^/]*\.json$"
90+
})
9191

9292
return $addedSwaggerFiles
9393
}
@@ -112,9 +112,9 @@ foreach ($file in $addedSwaggerFiles) {
112112
$swaggerFilesToBeTest += $file
113113

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

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

0 commit comments

Comments
 (0)