Skip to content

Commit

Permalink
support all contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
tyliec committed Feb 25, 2024
1 parent b73c509 commit 59e45c7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,31 @@ jobs:
echo "}}" >> contributors.json
cat contributors.json
- name: Collect all the contributors from allcontributors files
run: |
repositories=${{env.REPOSITORY_NAMES}}
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
if [ -s $repository-contributors.json ]; then
echo "Contributors found for $repository"
cat $repository-contributors.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"
rm $repository-contributors.json
else
echo "No contributors for $repository"
fi
done
cat contributors.json
- name: Use Node.js
uses: actions/setup-node@v3
with:
Expand Down

0 comments on commit 59e45c7

Please sign in to comment.