-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Description
Currently, the script checks for whether 'https://api.github.com/users/' + username gets a 200 response. If so, it will set the username (or nickname) as the GitHub issue assignee.
The problem is the user profile might return 200, but still not be assignable in the repo, which will cause the script to fail with an error like the following:
RuntimeError: Failed to import GitHub issue due to the following errors:
{
'id': 9969067,
'status': 'failed',
'url': 'https://api.github.com/repos/OWNER/REPO/import/issues/9969067',
'import_issues_url': 'https://api.github.com/repos/OWNER/REPO/import/issues',
'repository_url': 'https://api.github.com/repos/OWNER/REPO',
'created_at': '2024-06-19T18:23:13.000-07:00',
'updated_at': '2024-06-19T18:23:13.000-07:00',
'errors': [{'location': '/issue/assignee', 'resource': 'Issue', 'field': 'assignee', 'value': 'USER_NICKNAME_HERE', 'code': 'invalid'}]
}
The solution may be to use the GitHub API to list the available assignees, or check if a user is assignable, in that specific repo:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels