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

Error while collecting auth token #1

Closed julienvincent closed 1 year ago

julienvincent commented 1 year ago

I'm trying to use this plugin but am failing to launch it successfully. I am authenticated with Github using the gh cli.

If I launch Neovim with a GITHUB_TOKEN env set then it works fine, but I really don't want to do this.

I noticed that the plugin is looking at $HOME/.config/gh/hosts.yml for auth tokens:

https://github.com/topaxi/gh-actions.nvim/blob/4ee6bced414b533eb4f62f2494f319319453687c/lua/gh-actions/github.lua#L37

On my system this file does not contain any token information:

❯ cat $HOME/.config/gh/hosts.yml
github.com:
    user: julienvincent
    git_protocol: ssh

Some additional system status information:

❯ gh version
gh version 2.32.1 (2023-07-24)
https://github.com/cli/cli/releases/tag/v2.32.1
❯ gh auth status
github.com
  ✓ Logged in to github.com as julienvincent (keyring)
  ✓ Git operations for github.com configured to use ssh protocol.
  ✓ Token: gho_************************************
  ✓ Token scopes: gist, read:org, repo
julienvincent commented 1 year ago

It looks like the gh cli offers a gh auth token command which can print out the currently configured token.

I guess this could be used instead of looking into the filesystem. Might give this a stab if I get a few minutes.