diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml index b191551..e4860b6 100644 --- a/.github/workflows/contributors.yml +++ b/.github/workflows/contributors.yml @@ -54,6 +54,40 @@ jobs: sed -i '$ s/.$//' contributors.json 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 > $repository-contributors.json + + cat $repository-contributors.json + + if ! jq -e . >/dev/null 2>&1 <<< "$(cat $repository-contributors.json)"; then + echo "No contributors for $repository, or .all-contributorsrc is not valid JSON" + rm $repository-contributors.json + continue + fi + + 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-output.json)" \ + --arg repo "$repository" \ + '.contributors[$repo] |= (. + $newContributors) | + .contributors[$repo] |= unique_by(.username)' \ + "contributors.json" > temp.json && mv temp.json "contributors.json" + + rm $repository-contributors.json + rm $repository-output.json + + done + cat contributors.json - name: Use Node.js uses: actions/setup-node@v3 diff --git a/contributors.json b/contributors.json index 7f0e70a..f317b9d 100644 --- a/contributors.json +++ b/contributors.json @@ -2,24 +2,14 @@ "contributors": { "Hawaii-Zoning-Atlas": [ { - "username": "kmal808", - "avatar_url": "https://avatars.githubusercontent.com/u/20919083?v=4", - "url": "https://github.com/kmal808" - }, - { - "username": "tyliec", - "avatar_url": "https://avatars.githubusercontent.com/u/15609358?v=4", - "url": "https://github.com/tyliec" + "username": "Hooobot", + "avatar_url": "https://avatars.githubusercontent.com/u/73650949?v=4", + "url": "https://github.com/Hooobot" }, { - "username": "avenmia", - "avatar_url": "https://avatars.githubusercontent.com/u/17712276?v=4", - "url": "https://github.com/avenmia" - }, - { - "username": "operator130", - "avatar_url": "https://avatars.githubusercontent.com/u/105579826?v=4", - "url": "https://github.com/operator130" + "username": "MichelleShuey", + "avatar_url": "https://avatars.githubusercontent.com/u/120435891?v=4", + "url": "https://github.com/MichelleShuey" }, { "username": "TyPushesButtons", @@ -27,9 +17,14 @@ "url": "https://github.com/TyPushesButtons" }, { - "username": "Hooobot", - "avatar_url": "https://avatars.githubusercontent.com/u/73650949?v=4", - "url": "https://github.com/Hooobot" + "username": "airyclam", + "avatar_url": "https://avatars.githubusercontent.com/u/53859607?v=4", + "url": "https://github.com/airyclam" + }, + { + "username": "avenmia", + "avatar_url": "https://avatars.githubusercontent.com/u/17712276?v=4", + "url": "https://github.com/avenmia" }, { "username": "ggordn3r", @@ -37,24 +32,44 @@ "url": "https://github.com/ggordn3r" }, { - "username": "yenhtran", - "avatar_url": "https://avatars.githubusercontent.com/u/7283964?v=4", - "url": "https://github.com/yenhtran" - }, - { - "username": "airyclam", - "avatar_url": "https://avatars.githubusercontent.com/u/53859607?v=4", - "url": "https://github.com/airyclam" + "username": "jonathanswilcox", + "avatar_url": "https://avatars.githubusercontent.com/u/111539042?v=4", + "url": "https://github.com/jonathanswilcox" }, { "username": "kcoronel", "avatar_url": "https://avatars.githubusercontent.com/u/38144130?v=4", "url": "https://github.com/kcoronel" }, + { + "username": "kenz-bee", + "avatar_url": "https://avatars.githubusercontent.com/u/100083618?v=4", + "url": "https://github.com/kenz-bee" + }, + { + "username": "kmal808", + "avatar_url": "https://avatars.githubusercontent.com/u/20919083?v=4", + "url": "https://github.com/kmal808" + }, { "username": "kobebuckley", "avatar_url": "https://avatars.githubusercontent.com/u/42805189?v=4", "url": "https://github.com/kobebuckley" + }, + { + "username": "operator130", + "avatar_url": "https://avatars.githubusercontent.com/u/105579826?v=4", + "url": "https://github.com/operator130" + }, + { + "username": "tyliec", + "avatar_url": "https://avatars.githubusercontent.com/u/15609358?v=4", + "url": "https://github.com/tyliec" + }, + { + "username": "yenhtran", + "avatar_url": "https://avatars.githubusercontent.com/u/7283964?v=4", + "url": "https://github.com/yenhtran" } ], "HIERR": [ @@ -155,6 +170,11 @@ "avatar_url": "https://avatars.githubusercontent.com/u/73650949?v=4", "url": "https://github.com/Hooobot" }, + { + "username": "kahookele", + "avatar_url": "https://avatars.githubusercontent.com/u/130222500?v=4", + "url": "https://github.com/kahookele" + }, { "username": "avenmia", "avatar_url": "https://avatars.githubusercontent.com/u/17712276?v=4",