Last active
September 3, 2020 20:20
-
-
Save thspinto/e97cbfb80ec265e0f960253406c4efa4 to your computer and use it in GitHub Desktop.
Github scripts
This file contains hidden or 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 | |
| team="teamname" | |
| org="orgname" | |
| repos=$(hub api orgs/$org/repos --paginate | jq -rc '.[] | select(.archived == false and .disabled == false) | .name') | |
| IFS=$'\n' | |
| for repo in $repos | |
| do | |
| echo "Adding $repo" | |
| hub api -X PUT "/orgs/$org/teams/$team/repos/$org/$repo" | |
| echo | |
| done |
This file contains hidden or 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 | |
| users=$(hub api /orgs/quintoandar/members --paginate | jq -rc '.[] | .login') | |
| team="teamname" | |
| org="orgname" | |
| IFS=$'\n' | |
| for user in $users | |
| do | |
| echo "Adding $user" | |
| hub api -X PUT "/orgs/$org/teams/$team/memberships/$user" | |
| echo | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment