Skip to content

Commit

Permalink
Merge pull request #146 from andreasscherbaum/checks
Browse files Browse the repository at this point in the history
Update pre-commit checks and GitHub Action checks with more checks
  • Loading branch information
andreasscherbaum authored Feb 9, 2025
2 parents 8a30aed + b769bf5 commit 3bacc85
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/verify-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ jobs:
run: exit 1
if: steps.mastadon_count_friends.outputs.COUNT != '0'

- name: Find 'Linkedin' in postgresfriends.json file
run: echo "COUNT=$(grep -c 'Linkedin' postgresfriends.json)" >>$GITHUB_OUTPUT
id: linkedin_count_friends

- name: Show 'Linkedin' word count
run: echo "${{ steps.linkedin_count_friends.outputs.COUNT }}"

- name: Break if word 'Linkedin' is found
run: exit 1
if: steps.linkedin_count_friends.outputs.COUNT != '0'

- name: Find 'Bluesky' in postgresfriends.json file
run: echo "COUNT=$(grep -c 'Bluesky' postgresfriends.json)" >>$GITHUB_OUTPUT
id: bluesky_count_friends

- name: Show 'Bluesky' word count
run: echo "${{ steps.bluesky_count_friends.outputs.COUNT }}"

- name: Break if word 'Bluesky' is found
run: exit 1
if: steps.bluesky_count_friends.outputs.COUNT != '0'


- name: Verify JSON postgresprojects.json
run: jq -e "." < postgresprojects.json > /dev/null
Expand All @@ -69,3 +91,25 @@ jobs:
- name: Break if word 'Mastadon' is found
run: exit 1
if: steps.mastadon_count_projects.outputs.COUNT != '0'

- name: Find 'Linkedin' in postgresprojects.json file
run: echo "COUNT=$(grep -c 'Linkedin' postgresprojects.json)" >>$GITHUB_OUTPUT
id: linkedin_count_projects

- name: Show 'Linkedin' word count
run: echo "${{ steps.linkedin_count_projects.outputs.COUNT }}"

- name: Break if word 'Linkedin' is found
run: exit 1
if: steps.linkedin_count_projects.outputs.COUNT != '0'

- name: Find 'Bluesky' in postgresprojects.json file
run: echo "COUNT=$(grep -c 'Bluesky' postgresprojects.json)" >>$GITHUB_OUTPUT
id: bluesky_count_projects

- name: Show 'Bluesky' word count
run: echo "${{ steps.bluesky_count_projects.outputs.COUNT }}"

- name: Break if word 'Bluesky' is found
run: exit 1
if: steps.bluesky_count_projects.outputs.COUNT != '0'
28 changes: 28 additions & 0 deletions git-hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ then
exit 1
fi

echo "Check for 'Linkedin' instead of 'LinkedIn' ..."
if grep -q 'Linkedin' postgresfriends.json;
then
echo "String 'Linkedin' found in postgresfriends.json"
exit 1
fi

echo "Check for 'Bluesky' instead of 'BlueSky' ..."
if grep -q 'Bluesky' postgresfriends.json;
then
echo "String 'Bluesky' found in postgresfriends.json"
exit 1
fi

echo "Check postgresprojects.json syntax ..."
jq -e "." < postgresprojects.json > /dev/null

Expand All @@ -29,3 +43,17 @@ then
echo "String 'Mastadon' found in postgresprojects.json"
exit 1
fi

echo "Check for 'Linkedin' instead of 'LinkedIn' ..."
if grep -q 'Linkedin' postgresprojects.json;
then
echo "String 'Linkedin' found in postgresprojects.json"
exit 1
fi

echo "Check for 'Bluesky' instead of 'BlueSky' ..."
if grep -q 'Bluesky' postgresprojects.json;
then
echo "String 'Bluesky' found in postgresprojects.json"
exit 1
fi

0 comments on commit 3bacc85

Please sign in to comment.