File: validate-filename.yml

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (18 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 }}