diff --git a/.github/workflows/gitignore-formatting.yml b/.github/workflows/gitignore-formatting.yml index aafecb02..a7d33532 100644 --- a/.github/workflows/gitignore-formatting.yml +++ b/.github/workflows/gitignore-formatting.yml @@ -27,6 +27,11 @@ jobs: - name: Install formatting tools run: python -m pip install pre-commit-hooks==6.0.0 + - name: Install dos2unix + run: | + sudo apt-get update + sudo apt-get install --yes dos2unix + - name: Check all gitignore files recursively shell: bash run: | @@ -41,13 +46,14 @@ jobs: echo "Checking ${#files[@]} gitignore files." status=0 - mixed-line-ending --fix=lf -- "${files[@]}" || status=1 + dos2unix --keep-bom -- "${files[@]}" || status=1 trailing-whitespace-fixer -- "${files[@]}" || status=1 end-of-file-fixer -- "${files[@]}" || status=1 + git --no-pager diff --no-ext-diff --exit-code -- "${files[@]}" || status=1 + if (( status != 0 )); then - echo "::error::Formatting checks failed. See tool output and diff below." - git --no-pager diff --no-ext-diff -- "${files[@]}" + echo "::error::Formatting checks failed. See tool output and diff above." fi exit "$status"