Skip to content

Commit

Permalink
two separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
tyliec committed Feb 25, 2024
1 parent c2eda8b commit df78d98
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,18 @@ jobs:
continue
fi
cat $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
cat $repository-contributors.json | jq -r '.contributors[] | {username: .login, avatar_url: .avatar_url, url: .profile }' | jq -s . > $repository-output.json
echo "Contributors found for $repository"
cat $repository-output.json
jq --argjson newContributors "$(cat $repository-contributors.json)" \
'.contributors["$repository"] |= (. + $newContributors) |
.contributors["$repository"] |= unique_by(.username)' \
"contributors.json" > temp.json && mv temp.json "contributors.json"
jq --argjson newContributors "$(cat $repository-output.json)" \
'.contributors["$repository"] |= (. + $newContributors) |
.contributors["$repository"] |= unique_by(.username)' \
"contributors.json" > temp.json && mv temp.json "contributors.json"
rm $repository-contributors.json
else
echo "No contributors for $repository"
fi
rm $repository-contributors.json
rm $repository-output.json
done
Expand Down

0 comments on commit df78d98

Please sign in to comment.