Update onpush_builder.yaml

This commit is contained in:
Alexandre
2025-06-15 13:14:25 +02:00
committed by GitHub
parent bfe4aa04a4
commit 9c4072fc94

View File

@@ -45,27 +45,22 @@ jobs:
addon: ${{ fromJSON(needs.detect-changed-addons.outputs.changedAddons) }} addon: ${{ fromJSON(needs.detect-changed-addons.outputs.changedAddons) }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Fix non-printable Unicode spaces in changed text files - name: Fix non-printable Unicode spaces in all text files for this add-on
run: | run: |
echo "Finding changed files..." cd "${{ matrix.addon }}"
CHANGED_FILES=$(git diff --name-only origin/master...HEAD)
# Unicode blanks regex (covers all mentioned codepoints)
UNICODE_SPACES_REGEX=$'[\u00A0\u2002\u2003\u2007\u2008\u2009\u202F\u205F\u3000\u200B]' UNICODE_SPACES_REGEX=$'[\u00A0\u2002\u2003\u2007\u2008\u2009\u202F\u205F\u3000\u200B]'
find . -type f | while read -r file; do
for file in $CHANGED_FILES; do MIME_TYPE=$(file --mime-type -b "$file")
if [ -f "$file" ]; then if [[ "$MIME_TYPE" == text/* ]]; then
MIME_TYPE=$(file --mime-type -b "$file") echo "Fixing: $file"
if [[ "$MIME_TYPE" == text/* ]]; then perl -CSD -pe "s/$UNICODE_SPACES_REGEX/ /g" "$file" > "$file.tmp" && mv "$file.tmp" "$file"
echo "Fixing: $file" else
perl -CSD -pe "s/$UNICODE_SPACES_REGEX/ /g" "$file" > "$file.tmp" && mv "$file.tmp" "$file" echo "Skipping non-text file: $file ($MIME_TYPE)"
else
echo "Skipping non-text file: $file ($MIME_TYPE)"
fi
fi fi
done done
- name: Make all .sh scripts executable - name: Make all .sh scripts executable
run: | run: |
cd "${{ matrix.addon }}"
find . -type f -iname "*.sh" -exec chmod u+x {} \; find . -type f -iname "*.sh" -exec chmod u+x {} \;
- name: Commit if needed - name: Commit if needed
uses: EndBug/add-and-commit@v9 uses: EndBug/add-and-commit@v9