Hacktoberfest / hacktoberfest-repo-topic-apply

Cmd line tool to add a topic to your github repo, defaults to hacktoberfest
Apache License 2.0
48 stars 43 forks source link

Includes collaborator repositories, even if there is insufficient API access #24

Closed karenetheridge closed 3 years ago

karenetheridge commented 3 years ago

I am a collaborator on some repositories owned by other users. These repositories seem to be included by the -u option, and then there is an API error due to insufficient privileges.

For example, I am a collaborator on https://github.com/avar/dist-zilla-plugin-makemaker-awesome:

$ hfest-repo -t $GITHUB_OAUTH_TOKEN -u karenetheridge --labels
   • adding topic              repo=dist-zilla-plugin-makemaker-awesome topic=hacktoberfest
   ⨯ issue adding hacktoberfest topic to repo error=PUT https://api.github.com/repos/avar/dist-zilla-plugin-makemaker-awesome/topics: 404 Not Found [] repo=dist-zilla-plugin-makemaker-awesome
$ echo $?
1

These repositories should be skipped, because they are not under my username.

(It should also be possible to skip over API errors and continue on with the next repository -- you know, just in case there are other API errors you haven't anticipated.) :)

MasonEgger commented 3 years ago

Hi @karenetheridge, can you test against PR #25? This should skip collaborator repos but also not completely error out if the tool fails to add the topic to a repo that your user doesn't have access to.

karenetheridge commented 3 years ago

I'm not a go person and I don't see a Makefile, so I'm not sure how to compile it.

MasonEgger commented 3 years ago

I released this into v0.0.9 since it solved another problem. Feel free to download the tool and try it again. If a breaking issue still persists please reopen this ticket