updatecli icon indicating copy to clipboard operation
updatecli copied to clipboard

Feature Request: make GitHub token optional for githubRelease

Open jawnsy opened this issue 3 years ago • 2 comments

Is your feature request related to a problem?

The githubRelease source currently requires a token to be specified:

kind
----
ERROR: { ✗   { {  }}} github parameter(s) required: [token]

helm
----
ERROR: { ✗   { {  }}} github parameter(s) required: [token]

However, GitHub's API does not require a token (not providing a token means that requests may be rate limited aggressively, but the token is not a strict requirement).

When running updatecli in GitHub Actions, this is not a big deal, because we can use the GITHUB_TOKEN injected automatically by the system.

Solution you'd like

Attempt to download release information without a token, and only emit a warning if there is an error when running the request.

Alternatives you've considered

No response

Anything else?

The documentation says:

Information about published releases are available to everyone. Only users with push access will receive listings for draft releases.

Source: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#list-releases

jawnsy avatar Jul 19 '23 23:07 jawnsy

The current implementation relies on GitHub API v4 which requires a token. But you are right an improvement would be to switch to the v3 api if the token is not specified.

I am aware of Updatecli users who do not have a GitHub account (and don't want to have one) so I suggested them to use the json plugin for that. cfr https://github.com/updatecli/updatecli/issues/1060

olblak avatar Jul 20 '23 06:07 olblak

Also worth mentioning the github plugin is one of the oldest updatecli plugin and it would need some refactoring to split that login "package" into different one between source of kind githubrelease, action of kind github/pullrequest, and scm of kind github

I think @dduportal started looking into that

olblak avatar Jul 20 '23 06:07 olblak