-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
I've hit an issue where a gh api call returns a 409 and no body (or a blank body), and gh api doesn't seem to handle that gracefully. Reminds me of #1474, except that the body is empty. It's not a big deal, but it does make it a little harder to understand what's going on.
❯ gh --version
gh version 2.2.0 (2021-10-25)
https://github.com/cli/cli/releases/tag/v2.2.0
Steps to reproduce the behavior
- Go to a local repo whose owner has all repos enabled for GitHub Actions
- Call
gh api --include /orgs/{owner}/actions/permissions/repositories - Get an error back that isn't handled super-gracefully.
Expected vs actual behavior
- Expected a clear error message from
gh - Got:
json: cannot unmarshal string into Go struct field .Errors of type []json.RawMessage
Logs
❯ gh api --include /orgs/{owner}/actions/permissions/repositories
HTTP/2.0 409 Conflict
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Content-Length: 216
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Tue, 16 Nov 2021 15:13:29 GMT
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Server: GitHub.com
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Vary: Accept-Encoding, Accept, X-Requested-With
X-Accepted-Oauth-Scopes: admin:org
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Github-Media-Type: github.v3; format=json
X-Github-Request-Id: E461:4951:8FA8F8:1169BA6:6193CA98
X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
X-Oauth-Scopes: admin:org, gist, repo, workflow
X-Ratelimit-Limit: 5000
X-Ratelimit-Remaining: 4996
X-Ratelimit-Reset: 1637078997
X-Ratelimit-Resource: core
X-Ratelimit-Used: 4
X-Xss-Protection: 0
json: cannot unmarshal string into Go struct field .Errors of type []json.RawMessage
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic