mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-26 22:43:25 +01:00
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Lint On Change
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
run-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Fix non-breaking spaces
|
|
run: |
|
|
echo "Replacing non-breaking spaces (U+00A0) with regular spaces..."
|
|
find . -type f -not -path "./.git/*" -exec sed -i 's/\xC2\xA0/ /g' {} +
|
|
if [[ -n "$(git status --porcelain)" ]]; then
|
|
git config user.name "github-actions"
|
|
git config user.email "github-actions@github.com"
|
|
git add .
|
|
git commit -m "fix: replace non-breaking spaces with regular spaces"
|
|
git push
|
|
else
|
|
echo "No changes to commit."
|
|
fi
|
|
|
|
- name: Lint Code Base
|
|
uses: super-linter/super-linter/slim@main
|
|
env:
|
|
VALIDATE_ALL_CODEBASE: false
|
|
VALIDATE_CHECKOV: false
|
|
VALIDATE_PYTHON_PYLINT: false
|
|
VALIDATE_JSCPD: false
|
|
DEFAULT_BRANCH: master
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
VALIDATE_NATURAL_LANGUAGE: false
|