Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check out finetuned GitHub permissions #53

Open
danuker opened this issue Jan 30, 2023 · 0 comments
Open

Check out finetuned GitHub permissions #53

danuker opened this issue Jan 30, 2023 · 0 comments
Assignees
Labels

Comments

@danuker
Copy link
Contributor

danuker commented Jan 30, 2023

When a PR passes review, such as here, assigning the user fails:

Traceback (most recent call last):
  File ""/home/site/wwwroot/chevah/github_hooks_server/server.py"", line 81, in hook
    response = handle_event(event)
  File ""/home/site/wwwroot/chevah/github_hooks_server/server.py"", line 144, in handle_event
    return handler.dispatch(event)
  File ""/home/site/wwwroot/chevah/github_hooks_server/handler.py"", line 62, in dispatch
    return handler(event)
  File ""/home/site/wwwroot/chevah/github_hooks_server/handler.py"", line 139, in pull_request_review
    self._setApproveChanges(
  File ""/home/site/wwwroot/chevah/github_hooks_server/handler.py"", line 261, in _setApproveChanges
    issue.edit(assignees=[author_name])
  File ""/home/site/wwwroot/.python_packages/lib/site-packages/github3/decorators.py"", line 24, in auth_wrapper
    return func(self, *args, **kwargs)
  File ""/home/site/wwwroot/.python_packages/lib/site-packages/github3/issues/issue.py"", line 236, in edit
    json = self._json(self._patch(self._api, data=dumps(data)), 200)
  File ""/home/site/wwwroot/.python_packages/lib/site-packages/github3/models.py"", line 161, in _json
    raise exceptions.error_for(response)
github3.exceptions.ForbiddenError: 403 Must have admin rights to Repository."

The error says the bot needs Admin permissions. But perhaps there is a way to finetune it just for assigning people to PRs. Check out the GitHub docs; Triage role should be enough for "Close, reopen, and assign all issues and pull requests".

@danuker danuker self-assigned this Jan 30, 2023
@danuker danuker added the bug label Jan 30, 2023
@danuker danuker changed the title Check errors from Twisted hooks Check out finetuned GitHub permissions Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant