From 45f5a5e4c89854f9706ba0cd71c526939506caac Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Thu, 26 Sep 2024 21:49:02 +0200 Subject: [PATCH] Simple JSON validation --- .github/workflows/validate-json.yml | 27 ++++++++++++++++++++++++ lib/armbian-configng/config.ng.jobs.json | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/validate-json.yml diff --git a/.github/workflows/validate-json.yml b/.github/workflows/validate-json.yml new file mode 100644 index 000000000..005f9cdb8 --- /dev/null +++ b/.github/workflows/validate-json.yml @@ -0,0 +1,27 @@ +name: Validate JSON + +on: + pull_request: + types: [opened, reopened, edited, synchronize, review_requested] + +concurrency: + group: validate-json-${{github.event.pull_request.number}} + cancel-in-progress: true + +jobs: + editorconfig: + name: "Validate JSON" + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'config' + + - name: Check JSON + run: | + JSON=$(cat config/lib/armbian-configng/config.ng.jobs.json | jq) + EMPTY=$(echo $JSON | nl | grep '"author": ""' | awk '{print $1}' | paste -s -d, -) + echo "## Empty author in lines:" + echo $EMPTY >> $GITHUB_STEP_SUMMARY diff --git a/lib/armbian-configng/config.ng.jobs.json b/lib/armbian-configng/config.ng.jobs.json index 09123296d..c2c59a431 100644 --- a/lib/armbian-configng/config.ng.jobs.json +++ b/lib/armbian-configng/config.ng.jobs.json @@ -971,4 +971,4 @@ ] } ] -} \ No newline at end of file +}