mirror of
https://github.com/armbian/configng.git
synced 2026-01-06 10:37:41 -08:00
33 lines
839 B
YAML
33 lines
839 B
YAML
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: |
|
|
for file in config/tools/json/*.json; do
|
|
JSON=$(cat "$file" | jq)
|
|
EMPTY=$(cat "$file" | jq | nl | grep '"author": ""' | awk '{print $1}' | paste -s -d, -)
|
|
if [ -n "$EMPTY" ]; then
|
|
echo "## Warning: Empty author field in $file at lines:" >> $GITHUB_STEP_SUMMARY
|
|
echo $EMPTY >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
done
|
|
|