Created
October 6, 2022 16:31
-
-
Save narze/c7a1ba4760899222288b960b1356ddc9 to your computer and use it in GitHub Desktop.
Add contributers to my Hacktoberfest repos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER="tinarskii" | |
REPOS=( | |
"narze/DaiMai" | |
"narze/awesome-cheab-quotes" | |
"narze/awesome-salim-quotes" | |
"narze/coffee-to-code" | |
"narze/dumb-questions-th" | |
"narze/nunmun" | |
"narze/react-useless" | |
"narze/torpleng" | |
"narze/deploydeemai.today" | |
) | |
for REPO in "${REPOS[@]}"; do | |
echo "Adding user ${USER} to $REPO" | |
# https://docs.github.com/en/rest/collaborators/collaborators#add-a-repository-collaborator | |
gh api \ | |
--method PUT \ | |
-H "Accept: application/vnd.github+json" \ | |
"/repos/$REPO/collaborators/$USER" \ | |
-f permission='push' && echo 'Added' || echo 'Failed' | |
echo "\n============================================================\n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment