Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GHA #57

Merged
merged 3 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/workflows/validate-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ jobs:
json_validator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
with:
pattern: "\\.json$"
- name: Checkout
uses: actions/checkout@v2

- name: Check for duplicates
run : |
sh dupes.sh

- name: Check JSON syntax
run: |
if ! jq empty pools-v2.json; then
echo "JSON syntax check failed"
exit 1
fi
9 changes: 9 additions & 0 deletions dupes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
OUTPUT=$(cat pools-v2.json | jq 'group_by(.id) | map(select(length>1) | .[])')

if [ "$OUTPUT" = "[]" ]; then
echo "no duplicate pool ids found"
exit 0
else
echo "duplicate pool ids found: $OUTPUT"
exit 1
fi
Loading