When creating an app installation access token through the REST API (POST /app/installations/{installation_id}/access_tokens), if the repositories parameter is set to an empty array, the API returns a list of all accessible repositories. However, the client currently strips empty arrays (omitempty) when marshaling the InstallationAccessTokenOptions.Repositories value making that functionality inaccessible through the client.
| typeInstallationTokenOptionsstruct { |
| // The IDs of the repositories that the installation token can access. |
| // Providing repository IDs restricts the access of an installation token to specific repositories. |
| RepositoryIDs []int64`json:"repository_ids,omitempty"` |
| |
| // The names of the repositories that the installation token can access. |
| // Providing repository names restricts the access of an installation token to specific repositories. |
| Repositories []string`json:"repositories,omitempty"` |
| |
| // The permissions granted to the access token. |
| // The permissions object includes the permission names and their access type. |
| Permissions*InstallationPermissions`json:"permissions,omitempty"` |
| } |
When creating an app installation access token through the REST API (
POST /app/installations/{installation_id}/access_tokens), if therepositoriesparameter is set to an empty array, the API returns a list of all accessible repositories. However, the client currently strips empty arrays (omitempty) when marshaling theInstallationAccessTokenOptions.Repositoriesvalue making that functionality inaccessible through the client.go-github/github/apps.go
Lines 45 to 57 in 169ad4d