diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 42eb7cad8..37636bed4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -23,3 +23,8 @@ jobs: VALIDATE_JSON: true VALIDATE_MD: true DEFAULT_BRANCH: ${{ github.base_ref }} + + - name: Checking shebang lines in MacOS and Ubuntu releases. + shell: powershell + run: | + ./images.CI/shebang-linter.ps1 diff --git a/images.CI/shebang-linter.ps1 b/images.CI/shebang-linter.ps1 index f031f4a64..bba5ed02e 100644 --- a/images.CI/shebang-linter.ps1 +++ b/images.CI/shebang-linter.ps1 @@ -24,8 +24,8 @@ function Validate-Scripts { $PathUbuntu = "./images/linux/scripts" $PathMacOS = "./images/macos/provision" $ScriptsWithBrokenShebang = @() -$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -Pattern "#!/bin/bash -e" -$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -Pattern "#!/bin/bash -e -o pipefail" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathUbuntu -ExpectedShebang "#!/bin/bash -e" +$ScriptsWithBrokenShebang += Validate-Scripts -Path $PathMacOS -ExpectedShebang "#!/bin/bash -e -o pipefail" if ($ScriptsWithBrokenShebang.Length -gt 0) { $ScriptsWithBrokenShebang | ForEach-Object { Write-Warning "The following script does not contain shebang: '$_'"