Skip to content

Commit

Permalink
GitHub API requires admin:org to create teams
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Apr 20, 2024
1 parent fac4a8f commit 4da5a14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config_defaults.yml
Expand Up @@ -14,7 +14,7 @@ github:
# If null, connection to GitHub will be anonymous
# Generate at https://github.com/settings/tokens
# The token must have at least `public_repo` scope. Additionally,
# - `write:org` is required to run github_plugin_teams.py
# - `admin:org` is required to run github_plugin_teams.py
# Note: Fine-grained tokens are currently not supported
token: null

Expand Down
4 changes: 2 additions & 2 deletions github_plugin_teams.py
Expand Up @@ -75,7 +75,7 @@ def main():
gh.get_rate_limit()

# Make sure we have the required privilege
required_privileges = ['write:org', 'admin:org']
required_privileges = ['admin:org']
has_required_privilege = False
if gh.oauth_scopes is not None:
for privilege in required_privileges:
Expand All @@ -84,7 +84,7 @@ def main():
break
if not has_required_privilege:
print("""
ERROR: This script requires a Classic Token with the 'write:org' scope.
ERROR: This script requires a Classic Token with the 'admin:org' scope.
Please update the config.yml file and GitHub Token as appropriate
https://github.com/settings/tokens
Expand Down

0 comments on commit 4da5a14

Please sign in to comment.