Skip to content

Instantly share code, notes, and snippets.

@thspinto
Last active September 3, 2020 20:20
Show Gist options
  • Select an option

  • Save thspinto/e97cbfb80ec265e0f960253406c4efa4 to your computer and use it in GitHub Desktop.

Select an option

Save thspinto/e97cbfb80ec265e0f960253406c4efa4 to your computer and use it in GitHub Desktop.
Github scripts
#!/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
#!/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