mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-30 19:26:07 +02:00
Add normalize blanks
This commit is contained in:
32
.github/workflows/onpush_builder.yaml
vendored
32
.github/workflows/onpush_builder.yaml
vendored
@@ -51,6 +51,7 @@ jobs:
|
|||||||
commit: -u
|
commit: -u
|
||||||
message: "GitHub bot : scripts executable"
|
message: "GitHub bot : scripts executable"
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|
||||||
check-addon-changes:
|
check-addon-changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [correct_path_filters]
|
needs: [correct_path_filters]
|
||||||
@@ -99,9 +100,36 @@ jobs:
|
|||||||
message: "GitHub bot : scripts executable"
|
message: "GitHub bot : scripts executable"
|
||||||
default_author: github_actions
|
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:
|
lint_config:
|
||||||
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
|
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
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@@ -116,7 +144,7 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
|
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
|
runs-on: ubuntu-latest
|
||||||
environment: CR_PAT
|
environment: CR_PAT
|
||||||
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
|
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on
|
||||||
|
|||||||
Reference in New Issue
Block a user