diff --git a/eng/common/pipelines/templates/steps/validate-filename.yml b/eng/common/pipelines/templates/steps/validate-filename.yml new file mode 100644 index 0000000000..0f63e8977f --- /dev/null +++ b/eng/common/pipelines/templates/steps/validate-filename.yml @@ -0,0 +1,18 @@ +parameters: + WorkingDirectory: '$(System.DefaultWorkingDirectory)' +steps: + - pwsh: | + $differByCaseFiles = git ls-files | Group-Object | Where-Object { $_.Count -gt 1 } + + if ($differByCaseFiles) + { + foreach ($fileGroup in $differByCaseFiles) { + Write-Host "Duplicated Files: " + Write-Host "[ $($fileGroup.Group) ]" + } + Write-Host "Do NOT name the files which only differ in case. Please check above files." + exit 1 + } + Write-Host "There are no file names that only differ in case." + displayName: Check file case duplicates + workingDirectory: ${{ parameters.WorkingDirectory }} \ No newline at end of file