topaxi / pipeline.nvim

See status of ci/cd pipeline runs directly in neovim. Currently supports GitHub Actions and GitLab CI.
137 stars 5 forks source link

Get token from `gh` cli instead of from filesystem #2

Closed julienvincent closed 1 year ago

julienvincent commented 1 year ago

This updates the get_github_token fn to discover the authenticated user's auth token via the gh auth token cli command instead of by reading the token from $HOME/.config/gh/hosts.yml which doesn't contain the token in all scenarios.

Fixes #1

topaxi commented 1 year ago

Great! Thank you!

I assumed wrongly that the config might always be available and opted to read the file directly, as that has a little less overhead. But this seems more bullet/future proof! :partying_face: