Skip to content

Commit

Permalink
Support specifying repository names (#2123)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericnorris committed Oct 12, 2021
1 parent 6b0f37f commit e87b9aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions github/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ type InstallationTokenOptions struct {
// 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"`
Expand Down
1 change: 1 addition & 0 deletions github/apps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ func TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) {

installationTokenOptions := &InstallationTokenOptions{
RepositoryIDs: []int64{1234},
Repositories: []string{"foo"},
Permissions: &InstallationPermissions{
Contents: String("write"),
Issues: String("read"),
Expand Down

0 comments on commit e87b9aa

Please sign in to comment.