From 26726e3f12dc156273705914dc235738cd3612b9 Mon Sep 17 00:00:00 2001 From: Zhenhua Hu Date: Fri, 29 Nov 2024 19:47:52 +0800 Subject: [PATCH] bug fix --- eng/scripts/Armstrong-Validation.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/scripts/Armstrong-Validation.ps1 b/eng/scripts/Armstrong-Validation.ps1 index fff30d68b624..b3d7599c2e24 100644 --- a/eng/scripts/Armstrong-Validation.ps1 +++ b/eng/scripts/Armstrong-Validation.ps1 @@ -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 } @@ -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"