cli / cli

GitHub’s official command line tool
https://cli.github.com
MIT License
36.63k stars 5.59k forks source link

Update permissions error message to be more descriptive #3797

Open jongio opened 3 years ago

jongio commented 3 years ago

Describe the feature or problem you’d like to solve

Right now when I perform an operation where the current user doesn't have appropriate permissions I get this:

failed to fetch public key: HTTP 403: Resource not accessible by integration (https://api.github.com/repos/jongio/golang-sample-app/actions/secrets/public-key)

The issue in this case is that the env is Codespaces and the GITHUB_TOKEN assigned doesn't have perms to create a secret.

Proposed solution

I'd suggest a better error message like:

"You are not authorized to do that operation. Please login with an account that has appropriate permissions"

Additional context

Add any other context like screenshots or mockups are helpful, if applicable.

azsdke2e azsdke2e2

Griffin641498 commented 2 years ago

https://github.com/cli/cli/issues/3797#issue-913808034

brunoborges commented 2 years ago

Link to blog with workaround: https://blog.jongallant.com/2021/06/codespaces-gh-cli-git-credentials/