Giter Club home page Giter Club logo

Comments (18)

nedtwigg avatar nedtwigg commented on June 12, 2024 1

I'm seeing this same error in gh version 2.30.0, installed the extension just now. The workaround that worked for @gugaiz above did not work for me.

from gh-actions-cache.

kotewar avatar kotewar commented on June 12, 2024

Hi @gugaiz, have you logged in into gh cli before executing the command?

Please use gh auth login to login to your GitHub account to be able to access your repo.

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024

Hi @kotewar, thanks for your answer. I am already logged into gh. For example, if I run gh pr list on the repo directory, it works

from gh-actions-cache.

kotewar avatar kotewar commented on June 12, 2024

Hi @gugaiz, looks like it is a known thing, please refer this and let me know if the problem gets resolved for you.

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024

@kotewar, not sure if I explained myself right... What I meant was that if I run gh pr list I see all the pull requests for my repo, so it means that I am already logged, but if under that same repo I run gh actions-cache list, it does not work

from gh-actions-cache.

kotewar avatar kotewar commented on June 12, 2024

What is the output of git remote -v?

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024
$ git remote -v
origin	[email protected]:<company>/<repo-name>.git (fetch)
origin	[email protected]:<company>/<repo-name>.git (push)

from gh-actions-cache.

kotewar avatar kotewar commented on June 12, 2024

Is your company using GHES (GitHub Enterprise Server) by any chance?

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024

Not that I am aware of... is there any way to confirm that?

from gh-actions-cache.

kotewar avatar kotewar commented on June 12, 2024

Looking at your origin, it seems you are using the github.com site and not any enterprise instance.

Can you please paste the output of gh --version? I am unable to reproduce the issue. Just want to confirm what gh cli version you are using.

Also can you please enable verbose logging, by exporting an env variable GH_DEBUG=true, and share the logs?

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024
$ gh --version
gh version 2.14.4 (2022-08-10)
https://github.com/cli/cli/releases/tag/v2.14.4

I exported the GH_DEBUG variable but didn't see any output

$ export GH_DEBUG=true
$ gh actions-cache list
[actions-cache list] -> [actions-cache list]
Error: unable to determine current repository, none of the git remotes configured for this repository point to a known GitHub host
Usage:
  gh-actions-cache list [flags]

Flags:
  -B, --branch string   Filter by branch
  -h, --help            help for list
      --key string      Filter by key
      --limit int       Number of items to fetch between 1 and 100 (default 30)
      --order string    Order of caches returned (asc/desc)
  -R, --repo string     Select another repository for finding actions cache.
      --sort string     Sort fetched caches (last-used/size/created-at)

from gh-actions-cache.

t-dedah avatar t-dedah commented on June 12, 2024

Hi @gugaiz Will it be possible to explicitly give repo just to confirm where is the problem? Try something like this

gh actions-cache -R <org>/<repo-name>

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024

Hi @t-dedah I did:

$ gh actions-cache list -R <org>/<repo-name>
Error: authentication token not found for host github.com

Then I ran:

$ gh auth login
? What account do you want to log into? GitHub.com
? You're already logged into github.com. Do you want to re-authenticate? (y/N) y
....

Then it worked!, for some reason, that was not very clear, I was already logged but was not working for cache but it did work for another commands.

from gh-actions-cache.

t-dedah avatar t-dedah commented on June 12, 2024

Thats awesome @gugaiz

from gh-actions-cache.

gugaiz avatar gugaiz commented on June 12, 2024

@t-dedah thanks for all your help!

from gh-actions-cache.

catfishlty avatar catfishlty commented on June 12, 2024

@t-dedah
Hi~
I face the same problem but with GHES 3.6.x. I want to know that how can I solve this problem. Thanks~

gh actions-cache list -R <[HOST/]owner/repo
Error: authentication token not found for host xxx.xxx.xxx

And I can get cache list data by using gh api.

# GitHub CLI api
# https://cli.github.com/manual/gh_api

gh api \
  -H "Accept: application/vnd.github+json" \
  --hostname HOSTNAME \
  /repos/OWNER/REPO/actions/cache/usage

from gh-actions-cache.

VivaLaPanda avatar VivaLaPanda commented on June 12, 2024

I am also still seeing this

from gh-actions-cache.

zcahana avatar zcahana commented on June 12, 2024

Same here.

$ gh version
gh version 2.30.0 (2023-05-30)
https://github.com/cli/cli/releases/tag/v2.30.0

$ gh extension list
gh actions-cache  actions/gh-actions-cache  v1.0.3

$ gh actions-cache list --repo redislabsdev/next-gen
Error: authentication token not found for host github.com

$ gh auth login
? What account do you want to log into? GitHub.com
? You're already logged into github.com. Do you want to re-authenticate? Yes
? What is your preferred protocol for Git operations? SSH
? Upload your SSH public key to your GitHub account? Skip
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: 0E50-42B1
Press Enter to open github.com in your browser...
✓ Authentication complete.
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ Logged in as zcahana

$ gh actions-cache list --repo redislabsdev/next-gen
Error: authentication token not found for host github.com

from gh-actions-cache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.