-
Notifications
You must be signed in to change notification settings - Fork 8k
Labels
bugSomething isn't workingSomething isn't workingpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
This was reported to us by @skedwards88: accessing or doing an operation on an issue in an Actions workflow can fail with a json error:
gh issue close 123
json: cannot unmarshal number into Go struct field GraphQLError.Errors.Path of type string
It looks like this happen when
- The generated GITHUB_TOKEN was used;
- The issue was added as a card to an organization project.
Whenever we fetch an issue, we fetch the list of the projects it belongs to. However, if one of these projects is an organization-level project, the generated GITHUB_TOKEN will not have access to read its information since it only has access to the current repository.
I count several bugs here:
- We over-fetch GraphQL fields. In this case, fetching the list of project for an issue is absolutely not necessary to close an issue. We should instead only fetch the ID of an issue. Avoid over-fetching from the API in
prcommands #2849 - Our GraphQL error-handling mechanism doesn't handle the case when the
pathproperty of an error is an array that contains a mix of strings and numbers.Line 126 in 531b15c
Path []string - We currently don't anticipate that the current token might not have the privileges to read the information about all the projects the issue belongs to. Ideally, we should handle GraphQL errors with path
repository.issue.projectCards.nodes[*]as non-fatal and still allow thegh issuecommand to proceed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic