Add normalize blanks

This commit is contained in:
Alexandre
2025-05-27 10:22:53 +02:00
committed by GitHub
parent 57aa782fd1
commit 2127ad130e

View File

@@ -51,6 +51,7 @@ jobs:
commit: -u
message: "GitHub bot : scripts executable"
default_author: github_actions
check-addon-changes:
runs-on: ubuntu-latest
needs: [correct_path_filters]
@@ -99,9 +100,36 @@ jobs:
message: "GitHub bot : scripts executable"
default_author: github_actions
normalize-spaces:
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
needs: [check-addon-changes, make-executable, correct-CRLF]
runs-on: ubuntu-latest
strategy:
matrix:
addon: ${{ fromJSON(needs.check-addon-changes.outputs.changedAddons) }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Normalize all non-breaking spaces to regular spaces
run: |
set -e
cd "${{ matrix.addon }}"
# Find all files (excluding .git)
find . -type f ! -path "./.git/*" | while read -r file; do
# Replace all non-breaking spaces (U+00A0) with ASCII space
LC_ALL=C sed -i 's/\xC2\xA0/ /g' "$file"
# Optionally, replace other weird unicode spaces if needed (can be added here)
done
- name: Commit if normalization was needed
uses: EndBug/add-and-commit@v9
with:
commit: -u
message: "GitHub bot : normalize unicode spaces"
default_author: github_actions
lint_config:
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
needs: check-addon-changes
needs: [check-addon-changes, normalize-spaces, correct-CRLF, make-executable, correct_path_filters]
runs-on: ubuntu-latest
strategy:
matrix:
@@ -116,7 +144,7 @@ jobs:
build:
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
needs: [check-addon-changes, make-executable, correct-CRLF]
needs: [check-addon-changes, lint_config]
runs-on: ubuntu-latest
environment: CR_PAT
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on