Skip to content

It doesn't work without authentication credentials for github.com. #42

@kenchan

Description

@kenchan

gh-grep will encounter an error if only authentication credentials for GitHub Enterprise Server are available. This is a problem when using GitHub Actions with GitHub Enterprise Server.

I'll describe how to reproduce the issue below.

# authorized my-github.example.com

$ gh auth status
<my-github.example.com>
  ✓ Logged in to <my-github.example.com> as <my-user> (GH_ENTERPRISE_TOKEN)
  ✓ Git operations for <my-github.example.com> configured to use https protocol.
  ✓ Token: ghp_************************************
  ✓ Token scopes: admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:pre_receive_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages


# run gh grep

$ gh grep --owner me test
non-200 OK status code: 401 Unauthorized body: "{\"message\":\"This endpoint requires you to be authenticated.\",\"documentation_url\":\"https://docs.github.com/graphql/guides/forming-calls-with-graphql#authenticating-with-graphql\"}"
no assets match the file pattern


# other sub commands are avaiable

$ gh repo view 'myuser/myrepo' # => ok
$ gh api graphql -f query="query { viewer { email } }" # => ok

After sign-in github.com, gh grep will work for GitHub Enterprise Server.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions