diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index 7747b29..8a92ad2 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -62,7 +62,14 @@ jobs: for repository in ${repositories[@]} do echo "Collecting contributors for $repository" - curl -s https://raw.githubusercontent.com/CodeWithAloha/$repository/main/.all-contributorsrc | jq -r '.contributors[] | {username: .login, avatar_url: .avatar_url, url: .profile }' | jq -s . > $repository-contributors.json + curl -s https://raw.githubusercontent.com/CodeWithAloha/$repository/main/.all-contributorsrc > $repository-contributors.json + + if !jq -e . >/dev/null 2>&1 < $repository-contributors.json; then + echo "No contributors for $repository" + continue + fi + + echo $repository-contributors.json | jq -r '.contributors[] | {username: .login, avatar_url: .avatar_url, url: .profile }' | jq -s . > $repository-contributors.json if [ -s $repository-contributors.json ]; then echo "Contributors found for $repository" cat $repository-contributors.json