Skip to content

Check out finetuned GitHub permissions #53

@danuker

Description

@danuker

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".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions