tarides / dune-release

Streamlining the release of dune packages to opam
ISC License
111 stars 38 forks source link

Add github token to `config` #385

Open pitag-ha opened 2 years ago

pitag-ha commented 2 years ago

In my last release with dune-release I was informed by github that my github token had an outdated format and that it would be good to generate a new one. Probably that currently happens to most dune-release users. Currently, the only ways to edit the github token stored in dune-release is either to manually modify the file in which the token is stored or to manually delete that file in order to be prompted for a token in the next release. Most users don't know where that file is (or even that it exists) though.

So I suggest to provide a simple way to modify the github token stored in dune-release. Possibly the token could form part of dune-release config. Once we've addressed the issue asking to "display" the token with stars when inputting it, we can do the same for dune-release config show. For dune-release config set, we'd have to think about how to enter the new token without it being displayed in the terminal.

icristescu commented 2 years ago

I faced a similar issue, where the token used by dune-release was no longer available. I used the env variable DUNE_RELEASE_GITHUB_TOKEN to point dune-release to a new token. Indeed it would be nice if dune-release allowed users to verify/change their GitHub tokens.

reynir commented 3 months ago

Today my token did not work and the only message I got was that github reported error code 401. Presumably it either expired or I removed the token from GitHub as I don't use this computer much. It was in my opinion not easy at all to figure out where the token is stored, what kind of token it needs to be and what permissions. In general I found very little information in the help text / man pages, and I ended up searching the github repository. The token I generated does not allow dune-release to open a PR against opam-repository, annoyingly.