From 09e5bd7311e3f9a1f070cd768edf4d3f64223370 Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:02:12 +0100 Subject: [PATCH] ci: Add Action to check for tabs in JSON files (#21) * ci: Add Action to check for tabs in JSON files * temp: Test no CI by inserting tabs * Revert "temp: Test no CI by inserting tabs" This reverts commit 2870137283d9c552b9b8645aa3968bef8f0b9e78. --- .github/workflows/no-tabs.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/no-tabs.yml diff --git a/.github/workflows/no-tabs.yml b/.github/workflows/no-tabs.yml new file mode 100644 index 0000000..b7732d7 --- /dev/null +++ b/.github/workflows/no-tabs.yml @@ -0,0 +1,19 @@ +name: Check for tabs in JSON files + +on: [push, pull_request] + +jobs: + check-for-tabs-in-json: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check JSON files for tabs + run: | + set -e + + for file in $(find . -type f -name '*.json'); do + if grep --perl-regexp --quiet '\t' "$file"; then + echo "Error: JSON file $file contains tabs." + exit 1 + fi + done