diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index e045b7d1a..be319f5e1 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -6,7 +6,7 @@ on: pull_request: env: - LLVM_VERSION: 15 + LLVM_VERSION: 17 jobs: format: @@ -21,27 +21,18 @@ jobs: - name: Pin to a specific version run: | - $latestChocoVersion = (Get-LatestChocoPackageVersion -TargetVersion $env:LLVM_VERSION -PackageName "llvm") - Choco-Install -PackageName llvm -ArgumentList '--allow-downgrade', '--version', $latestChocoVersion + $latestChocoVersion = (Resolve-ChocoPackageVersion -PackageName "llvm" -TargetVersion $env:LLVM_VERSION) + Install-ChocoPackage -PackageName llvm -ArgumentList '--allow-downgrade', '--version', $latestChocoVersion - name: Run clang-format env: RED4EXT_COMMIT_BEFORE: ${{ github.event.pull_request.base.sha || github.event.before }} RED4EXT_COMMIT_AFTER: ${{ github.sha }} - run: | - $output = (git ` - -c core.autocrlf=false ` - -c core.eol=lf ` - -c color.ui=always ` - clang-format ` - --style file ` - --diff $env:RED4EXT_COMMIT_BEFORE $env:RED4EXT_COMMIT_AFTER - )?.Trim() - - Write-Output $output - - # A temporary fix for https://github.com/llvm/llvm-project/issues/56736. - # TODO: Once LLVM 16 is released, reduce this to only the "git ... clang-format ..." command. - if ($LASTEXITCODE -eq 1 -and !$output) { - exit 0 - } + run: >- + git + -c core.autocrlf=false + -c core.eol=lf + -c color.ui=always + clang-format + --style file + --diff $env:RED4EXT_COMMIT_BEFORE $env:RED4EXT_COMMIT_AFTER