File: validate-filename.yml

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
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 }}