Created
October 18, 2022 09:28
-
-
Save rastandy/2fa2c68172704a01f62a81595123532c to your computer and use it in GitHub Desktop.
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=$1 | |
repo=$2 | |
permissions=$3 | |
echo "Adding ${user} to repo ${repo} with permissions ${permissions}..." | |
gh api -XPUT repos/${repo}/collaborators/${user} -f permission=${permissions} | |
echo "done." |
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=$1 | |
repos_file=$2 | |
permissions=$3 | |
for i in `cat ${repos_file}` | |
do | |
./add-user-to-repo.sh ${user} ${i} ${permissions} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding a user to a Github repository with specific permissions.
Also adding a user to a list of Github repositories in a file with specific permissions.