From 91f1c23667b3e0bd38e44b728f87e67f775a8691 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 6 Jul 2022 19:13:02 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 3480 (#2258) * Check file case duplication * Save changes Co-authored-by: sizhu --- .../templates/steps/validate-filename.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 eng/common/pipelines/templates/steps/validate-filename.yml 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