From e87b9aa0c3e40c8bb64cf215558ff9903f90d408 Mon Sep 17 00:00:00 2001 From: Eric Norris <1906605+ericnorris@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:00:04 -0400 Subject: [PATCH] Support specifying repository names (#2123) --- github/apps.go | 4 ++++ github/apps_test.go | 1 + 2 files changed, 5 insertions(+) diff --git a/github/apps.go b/github/apps.go index 8b850d9e5d3..3823a121969 100644 --- a/github/apps.go +++ b/github/apps.go @@ -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"` diff --git a/github/apps_test.go b/github/apps_test.go index 5079d41614a..e003e27886f 100644 --- a/github/apps_test.go +++ b/github/apps_test.go @@ -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"),