Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using token from GitHub CLI (gh) doesn't seem to work #332

Closed
pbek opened this issue May 20, 2023 · 9 comments · Fixed by #334
Closed

Using token from GitHub CLI (gh) doesn't seem to work #332

pbek opened this issue May 20, 2023 · 9 comments · Fixed by #334

Comments

@pbek
Copy link

pbek commented May 20, 2023

Thank you for this wonderful way to test PRs!

Although, using the token from GitHub CLI (gh) doesn't seem to work for me.
nixpkgs-review-2.9.1 from the nix store.
gh version 2.29.0 (1980-01-01) from the nix store.

I'm logged in into gh (just got a fresh token again).
But my ~/.config/gh/hosts.yml looks like this, no token there:

github.com:
    user: pbek
    git_protocol: ssh

nixpkgs-review says:

Posting PR comments requires a Github API token; see https://github.com/Mic92/nixpkgs-review#github-api-token
@figsoda
Copy link
Collaborator

figsoda commented May 20, 2023

it might have something to do with cli/cli#7276

@pbek
Copy link
Author

pbek commented May 20, 2023

@wegank
Copy link

wegank commented May 25, 2023

Also encountered this on a freshly-installed NixOS instance.

A temporary fix is to gh auth login --insecure-storage.

@pbek
Copy link
Author

pbek commented May 25, 2023

https://github.com/zalando/go-keyring is used in the GitHub CLI to access the keyring, I wonder if nixpkgs-review can (is allowed to) load the token of the GitHub CLI.

@pbek
Copy link
Author

pbek commented May 25, 2023

I can see the token in kdewallet:

image

gh auth token also prints the token, maybe that could be used by nixpkgs-review.

@Mic92
Copy link
Owner

Mic92 commented May 29, 2023

Is there some cli tools present in those desktop environments to easily access keyrings? Otherwise I would just start adding a nixpkgs-review configuration to store secrets (maybe using python's new toml parser).

@pbek
Copy link
Author

pbek commented May 29, 2023

I wouldn't bother, if you want to execute a CLI tool you can as well run gh auth token in my opinion.

@Mic92
Copy link
Owner

Mic92 commented Jun 11, 2023

Ah. I wasn't aware of this option.

@pbek
Copy link
Author

pbek commented Jun 12, 2023

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants