If you’ve ever had to add several users to a team in a GitHub organization, you know it can be a pain as it’s one user at a time and multiple clicks per add. This script aims to simplify that by adding users to a GitHub org team programmatically from a CSV file.
0. Prerequisite: You need to make sure to have the gh cli installed and authorized (
gh auth login).
1. Creates a
users.csv with the list of users to add to the team, one per line, and leave a trailing empty line/whitespace at the end of the file. The file should look like:
1 2 3 user1 user2
2. From there, it’s pretty simple - run the script:
1 ./add-users-to-team-from-list.sh users.csv <org> <team>
Hopefully this saves you some time in the UI when adding multiple users to a team!