diff --git a/github/config.go b/github/config.go index 691fc8e169..ca6d178ce3 100644 --- a/github/config.go +++ b/github/config.go @@ -6,7 +6,7 @@ import ( "net/url" "path" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" diff --git a/github/data_source_github_branch.go b/github/data_source_github_branch.go index 6227937b6b..04fa604bcd 100644 --- a/github/data_source_github_branch.go +++ b/github/data_source_github_branch.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_collaborators.go b/github/data_source_github_collaborators.go index b168354361..618222eb49 100644 --- a/github/data_source_github_collaborators.go +++ b/github/data_source_github_collaborators.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index b832141561..c72837fd4c 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -4,7 +4,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_organization_team_sync_groups.go b/github/data_source_github_organization_team_sync_groups.go index 857f4a30c0..46aca23a5a 100644 --- a/github/data_source_github_organization_team_sync_groups.go +++ b/github/data_source_github_organization_team_sync_groups.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_release.go b/github/data_source_github_release.go index 978bc6206b..da2413038c 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index bcc10b0369..5ad148befd 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index c955acd632..94bf62befd 100644 --- a/github/data_source_github_repository_pull_requests.go +++ b/github/data_source_github_repository_pull_requests.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 4734340572..4d89c88f76 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_actions_environment_secret.go b/github/resource_github_actions_environment_secret.go index 047c77a5e8..b1a8ef403f 100644 --- a/github/resource_github_actions_environment_secret.go +++ b/github/resource_github_actions_environment_secret.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret.go b/github/resource_github_actions_organization_secret.go index d3d7c3d12f..1932a86a30 100644 --- a/github/resource_github_actions_organization_secret.go +++ b/github/resource_github_actions_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_secret.go b/github/resource_github_actions_secret.go index ab7aa83618..20b4818861 100644 --- a/github/resource_github_actions_secret.go +++ b/github/resource_github_actions_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "golang.org/x/crypto/nacl/box" ) diff --git a/github/resource_github_app_installation_repository.go b/github/resource_github_app_installation_repository.go index cd8caaa127..a2b130caea 100644 --- a/github/resource_github_app_installation_repository.go +++ b/github/resource_github_app_installation_repository.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 618b786dfe..bc4e9fac88 100644 --- a/github/resource_github_branch.go +++ b/github/resource_github_branch.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch_default.go b/github/resource_github_branch_default.go index cacef72c23..c463d53ca8 100644 --- a/github/resource_github_branch_default.go +++ b/github/resource_github_branch_default.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch_protection_v3.go b/github/resource_github_branch_protection_v3.go index 6f3c9591dd..787af1e7e5 100644 --- a/github/resource_github_branch_protection_v3.go +++ b/github/resource_github_branch_protection_v3.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_branch_protection_v3_utils.go b/github/resource_github_branch_protection_v3_utils.go index e36bc564fd..3916a828a1 100644 --- a/github/resource_github_branch_protection_v3_utils.go +++ b/github/resource_github_branch_protection_v3_utils.go @@ -7,7 +7,7 @@ import ( "log" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index b3878ab072..2749821e13 100644 --- a/github/resource_github_issue_label.go +++ b/github/resource_github_issue_label.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 88bed69bf2..77e4dcb843 100644 --- a/github/resource_github_membership.go +++ b/github/resource_github_membership.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index bd3de8c321..28793d14e5 100644 --- a/github/resource_github_membership_test.go +++ b/github/resource_github_membership_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index d530b10140..8c19f82ba2 100644 --- a/github/resource_github_organization_project.go +++ b/github/resource_github_organization_project.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index f963aa1aea..3416f5d419 100644 --- a/github/resource_github_organization_project_test.go +++ b/github/resource_github_organization_project_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 553b5688ba..28c2687176 100644 --- a/github/resource_github_organization_webhook.go +++ b/github/resource_github_organization_webhook.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_card.go b/github/resource_github_project_card.go index 019f732e5c..0d30e50292 100644 --- a/github/resource_github_project_card.go +++ b/github/resource_github_project_card.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index 5d4763328c..baffc09127 100644 --- a/github/resource_github_project_column.go +++ b/github/resource_github_project_column.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index ed5e37269a..204487b2cb 100644 --- a/github/resource_github_project_column_test.go +++ b/github/resource_github_project_column_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index 9eb1b502c3..7a9772f328 100644 --- a/github/resource_github_repository.go +++ b/github/resource_github_repository.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index e5827b3a8a..668e3845f5 100644 --- a/github/resource_github_repository_collaborator.go +++ b/github/resource_github_repository_collaborator.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index 8f2f9f02f5..addc132c6d 100644 --- a/github/resource_github_repository_deploy_key.go +++ b/github/resource_github_repository_deploy_key.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_environment.go b/github/resource_github_repository_environment.go index 4a5fe3e7d4..1c50a34472 100644 --- a/github/resource_github_repository_environment.go +++ b/github/resource_github_repository_environment.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_file.go b/github/resource_github_repository_file.go index 78db6c3015..fc395b9299 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -8,7 +8,7 @@ import ( "fmt" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -331,7 +331,7 @@ func resourceGithubRepositoryFileDelete(d *schema.ResourceData, meta interface{} // checkRepositoryBranchExists tests if a branch exists in a repository. func checkRepositoryBranchExists(client *github.Client, owner, repo, branch string) error { ctx := context.WithValue(context.Background(), ctxId, buildTwoPartID(repo, branch)) - _, _, err := client.Repositories.GetBranch(ctx, owner, repo, branch) + _, _, err := client.Repositories.GetBranch(ctx, owner, repo, branch, true) if err != nil { if ghErr, ok := err.(*github.ErrorResponse); ok { if ghErr.Response.StatusCode == http.StatusNotFound { diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index fcecf4f513..95b423491a 100644 --- a/github/resource_github_repository_milestone.go +++ b/github/resource_github_repository_milestone.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index b11324263e..9d3ccba164 100644 --- a/github/resource_github_repository_project.go +++ b/github/resource_github_repository_project.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_pull_request.go b/github/resource_github_repository_pull_request.go index faf5258dd9..18e0e9ddc9 100644 --- a/github/resource_github_repository_pull_request.go +++ b/github/resource_github_repository_pull_request.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index 0e51ed809a..51141bd236 100644 --- a/github/resource_github_repository_webhook.go +++ b/github/resource_github_repository_webhook.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index ae5543463d..cf6de5649f 100644 --- a/github/resource_github_team.go +++ b/github/resource_github_team.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/shurcooL/githubv4" diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 70ab015130..985038a4d9 100644 --- a/github/resource_github_team_membership.go +++ b/github/resource_github_team_membership.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index e40eeaff20..88dd449872 100644 --- a/github/resource_github_team_membership_test.go +++ b/github/resource_github_team_membership_test.go @@ -7,7 +7,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index 4710452ca6..b39233f27f 100644 --- a/github/resource_github_team_repository.go +++ b/github/resource_github_team_repository.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping.go b/github/resource_github_team_sync_group_mapping.go index 1d7ee053dd..a0a35d1ee3 100644 --- a/github/resource_github_team_sync_group_mapping.go +++ b/github/resource_github_team_sync_group_mapping.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping_test.go b/github/resource_github_team_sync_group_mapping_test.go index 3b824c1145..ff0a41bf7d 100644 --- a/github/resource_github_team_sync_group_mapping_test.go +++ b/github/resource_github_team_sync_group_mapping_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -206,7 +206,7 @@ resource "github_team" "test_team" { resource "github_team_sync_group_mapping" "test_mapping" { team_slug = github_team.test_team.slug - + dynamic "group" { for_each = [for g in data.github_organization_team_sync_groups.test_groups.groups : g if length(regexall("^acctest-github-provider", g.group_name)) > 0] content { @@ -214,7 +214,7 @@ resource "github_team_sync_group_mapping" "test_mapping" { group_name = group.value.group_name group_description = group.value.group_description } - } + } } `, teamName) } @@ -230,7 +230,7 @@ resource "github_team" "test_team" { resource "github_team_sync_group_mapping" "test_mapping" { team_slug = github_team.test_team.slug - + dynamic "group" { for_each = [for g in data.github_organization_team_sync_groups.test_groups.groups : g if length(regexall("^acctest-github-provider", g.group_name)) > 0] content { @@ -238,7 +238,7 @@ resource "github_team_sync_group_mapping" "test_mapping" { group_name = group.value.group_name group_description = "%s" } - } + } } `, teamName, description) } diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index a40d549a31..571e83373a 100644 --- a/github/resource_github_user_gpg_key.go +++ b/github/resource_github_user_gpg_key.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 659dd255f3..a8acc44503 100644 --- a/github/resource_github_user_ssh_key.go +++ b/github/resource_github_user_ssh_key.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index 0bd49db79f..8a713c0d78 100644 --- a/github/resource_organization_block.go +++ b/github/resource_organization_block.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 74102da877..820dd7781c 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index e1939ecc43..421633692f 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index 2735ff34de..7b7af76ac1 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v36/github" + "github.com/google/go-github/v37/github" ) const ( diff --git a/go.mod b/go.mod index 27f03e562f..854756f4fd 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.25.1 - github.com/google/go-github/v36 v36.0.0 + github.com/google/go-github/v37 v37.0.0 github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 // indirect github.com/hashicorp/hcl/v2 v2.3.0 // indirect github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect diff --git a/go.sum b/go.sum index 2e91a4eabb..c0c812fff8 100644 --- a/go.sum +++ b/go.sum @@ -157,8 +157,10 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v36 v36.0.0 h1:ndCzM616/oijwufI7nBRa+5eZHLldT+4yIB68ib5ogs= -github.com/google/go-github/v36 v36.0.0/go.mod h1:LFlKC047IOqiglRGNqNb9s/iAPTnnjtlshm+bxp+kwk= +github.com/google/go-github/v37 v36.0.0 h1:ndCzM616/oijwufI7nBRa+5eZHLldT+4yIB68ib5ogs= +github.com/google/go-github/v37 v36.0.0/go.mod h1:LFlKC047IOqiglRGNqNb9s/iAPTnnjtlshm+bxp+kwk= +github.com/google/go-github/v37 v37.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM= +github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= diff --git a/vendor/github.com/google/go-github/v36/AUTHORS b/vendor/github.com/google/go-github/v37/AUTHORS similarity index 100% rename from vendor/github.com/google/go-github/v36/AUTHORS rename to vendor/github.com/google/go-github/v37/AUTHORS diff --git a/vendor/github.com/google/go-github/v36/LICENSE b/vendor/github.com/google/go-github/v37/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v36/LICENSE rename to vendor/github.com/google/go-github/v37/LICENSE diff --git a/vendor/github.com/google/go-github/v36/github/actions.go b/vendor/github.com/google/go-github/v37/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions.go rename to vendor/github.com/google/go-github/v37/github/actions.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_artifacts.go b/vendor/github.com/google/go-github/v37/github/actions_artifacts.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v37/github/actions_artifacts.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v37/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v37/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_runners.go b/vendor/github.com/google/go-github/v37/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_runners.go rename to vendor/github.com/google/go-github/v37/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_secrets.go b/vendor/github.com/google/go-github/v37/github/actions_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_secrets.go rename to vendor/github.com/google/go-github/v37/github/actions_secrets.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v37/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v37/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v37/github/actions_workflow_runs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v37/github/actions_workflow_runs.go diff --git a/vendor/github.com/google/go-github/v36/github/actions_workflows.go b/vendor/github.com/google/go-github/v37/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/actions_workflows.go rename to vendor/github.com/google/go-github/v37/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v36/github/activity.go b/vendor/github.com/google/go-github/v37/github/activity.go similarity index 59% rename from vendor/github.com/google/go-github/v36/github/activity.go rename to vendor/github.com/google/go-github/v37/github/activity.go index 4310564bac..e683afb99b 100644 --- a/vendor/github.com/google/go-github/v36/github/activity.go +++ b/vendor/github.com/google/go-github/v37/github/activity.go @@ -21,22 +21,25 @@ type FeedLink struct { // Feeds represents timeline resources in Atom format. type Feeds struct { - TimelineURL *string `json:"timeline_url,omitempty"` - UserURL *string `json:"user_url,omitempty"` - CurrentUserPublicURL *string `json:"current_user_public_url,omitempty"` - CurrentUserURL *string `json:"current_user_url,omitempty"` - CurrentUserActorURL *string `json:"current_user_actor_url,omitempty"` - CurrentUserOrganizationURL *string `json:"current_user_organization_url,omitempty"` - CurrentUserOrganizationURLs []string `json:"current_user_organization_urls,omitempty"` - Links *struct { - Timeline *FeedLink `json:"timeline,omitempty"` - User *FeedLink `json:"user,omitempty"` - CurrentUserPublic *FeedLink `json:"current_user_public,omitempty"` - CurrentUser *FeedLink `json:"current_user,omitempty"` - CurrentUserActor *FeedLink `json:"current_user_actor,omitempty"` - CurrentUserOrganization *FeedLink `json:"current_user_organization,omitempty"` - CurrentUserOrganizations []*FeedLink `json:"current_user_organizations,omitempty"` - } `json:"_links,omitempty"` + TimelineURL *string `json:"timeline_url,omitempty"` + UserURL *string `json:"user_url,omitempty"` + CurrentUserPublicURL *string `json:"current_user_public_url,omitempty"` + CurrentUserURL *string `json:"current_user_url,omitempty"` + CurrentUserActorURL *string `json:"current_user_actor_url,omitempty"` + CurrentUserOrganizationURL *string `json:"current_user_organization_url,omitempty"` + CurrentUserOrganizationURLs []string `json:"current_user_organization_urls,omitempty"` + Links *FeedLinks `json:"_links,omitempty"` +} + +// FeedLinks represents the links in a Feed. +type FeedLinks struct { + Timeline *FeedLink `json:"timeline,omitempty"` + User *FeedLink `json:"user,omitempty"` + CurrentUserPublic *FeedLink `json:"current_user_public,omitempty"` + CurrentUser *FeedLink `json:"current_user,omitempty"` + CurrentUserActor *FeedLink `json:"current_user_actor,omitempty"` + CurrentUserOrganization *FeedLink `json:"current_user_organization,omitempty"` + CurrentUserOrganizations []*FeedLink `json:"current_user_organizations,omitempty"` } // ListFeeds lists all the feeds available to the authenticated user. diff --git a/vendor/github.com/google/go-github/v36/github/activity_events.go b/vendor/github.com/google/go-github/v37/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/activity_events.go rename to vendor/github.com/google/go-github/v37/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v36/github/activity_notifications.go b/vendor/github.com/google/go-github/v37/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/activity_notifications.go rename to vendor/github.com/google/go-github/v37/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v36/github/activity_star.go b/vendor/github.com/google/go-github/v37/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/activity_star.go rename to vendor/github.com/google/go-github/v37/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v36/github/activity_watching.go b/vendor/github.com/google/go-github/v37/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/activity_watching.go rename to vendor/github.com/google/go-github/v37/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v36/github/admin.go b/vendor/github.com/google/go-github/v37/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/admin.go rename to vendor/github.com/google/go-github/v37/github/admin.go diff --git a/vendor/github.com/google/go-github/v36/github/admin_orgs.go b/vendor/github.com/google/go-github/v37/github/admin_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/admin_orgs.go rename to vendor/github.com/google/go-github/v37/github/admin_orgs.go diff --git a/vendor/github.com/google/go-github/v36/github/admin_stats.go b/vendor/github.com/google/go-github/v37/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/admin_stats.go rename to vendor/github.com/google/go-github/v37/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v36/github/admin_users.go b/vendor/github.com/google/go-github/v37/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/admin_users.go rename to vendor/github.com/google/go-github/v37/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v36/github/apps.go b/vendor/github.com/google/go-github/v37/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/apps.go rename to vendor/github.com/google/go-github/v37/github/apps.go diff --git a/vendor/github.com/google/go-github/v36/github/apps_installation.go b/vendor/github.com/google/go-github/v37/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/apps_installation.go rename to vendor/github.com/google/go-github/v37/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v36/github/apps_manifest.go b/vendor/github.com/google/go-github/v37/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/apps_manifest.go rename to vendor/github.com/google/go-github/v37/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v36/github/apps_marketplace.go b/vendor/github.com/google/go-github/v37/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v37/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v36/github/authorizations.go b/vendor/github.com/google/go-github/v37/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/authorizations.go rename to vendor/github.com/google/go-github/v37/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v36/github/billing.go b/vendor/github.com/google/go-github/v37/github/billing.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/billing.go rename to vendor/github.com/google/go-github/v37/github/billing.go diff --git a/vendor/github.com/google/go-github/v36/github/checks.go b/vendor/github.com/google/go-github/v37/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/checks.go rename to vendor/github.com/google/go-github/v37/github/checks.go diff --git a/vendor/github.com/google/go-github/v36/github/code-scanning.go b/vendor/github.com/google/go-github/v37/github/code-scanning.go similarity index 86% rename from vendor/github.com/google/go-github/v36/github/code-scanning.go rename to vendor/github.com/google/go-github/v37/github/code-scanning.go index 9eb711cf43..8602c44632 100644 --- a/vendor/github.com/google/go-github/v36/github/code-scanning.go +++ b/vendor/github.com/google/go-github/v37/github/code-scanning.go @@ -18,11 +18,23 @@ import ( // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning/ type CodeScanningService service +// Tool represents the tool used to generate a GitHub Code Scanning Alert. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository +type Tool struct { + Name *string `json:"name,omitempty"` + GUID *string `json:"guid,omitempty"` + Version *string `json:"version,omitempty"` +} + +// Alert represents an individual GitHub Code Scanning Alert on a single repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository type Alert struct { RuleID *string `json:"rule_id,omitempty"` RuleSeverity *string `json:"rule_severity,omitempty"` RuleDescription *string `json:"rule_description,omitempty"` - Tool *string `json:"tool,omitempty"` + Tool *Tool `json:"tool,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` Open *bool `json:"open,omitempty"` ClosedBy *User `json:"closed_by,omitempty"` diff --git a/vendor/github.com/google/go-github/v36/github/doc.go b/vendor/github.com/google/go-github/v37/github/doc.go similarity index 99% rename from vendor/github.com/google/go-github/v36/github/doc.go rename to vendor/github.com/google/go-github/v37/github/doc.go index 4daa64d9f5..bd2e3ea063 100644 --- a/vendor/github.com/google/go-github/v36/github/doc.go +++ b/vendor/github.com/google/go-github/v37/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v36/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v37/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) import "github.com/google/go-github/github" // with go modules disabled Construct a new GitHub client, then use the various services on the client to diff --git a/vendor/github.com/google/go-github/v36/github/enterprise.go b/vendor/github.com/google/go-github/v37/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/enterprise.go rename to vendor/github.com/google/go-github/v37/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v36/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v37/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v37/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v36/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v37/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v37/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v36/github/event.go b/vendor/github.com/google/go-github/v37/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/event.go rename to vendor/github.com/google/go-github/v37/github/event.go diff --git a/vendor/github.com/google/go-github/v36/github/event_types.go b/vendor/github.com/google/go-github/v37/github/event_types.go similarity index 92% rename from vendor/github.com/google/go-github/v36/github/event_types.go rename to vendor/github.com/google/go-github/v37/github/event_types.go index 48347f37d0..f99a1296a0 100644 --- a/vendor/github.com/google/go-github/v36/github/event_types.go +++ b/vendor/github.com/google/go-github/v37/github/event_types.go @@ -215,66 +215,111 @@ type GollumEvent struct { // EditChange represents the changes when an issue, pull request, or comment has // been edited. type EditChange struct { - Title *struct { - From *string `json:"from,omitempty"` - } `json:"title,omitempty"` - Body *struct { - From *string `json:"from,omitempty"` - } `json:"body,omitempty"` - Base *struct { - Ref *struct { - From *string `json:"from,omitempty"` - } `json:"ref,omitempty"` - SHA *struct { - From *string `json:"from,omitempty"` - } `json:"sha,omitempty"` - } `json:"base,omitempty"` + Title *EditTitle `json:"title,omitempty"` + Body *EditBody `json:"body,omitempty"` + Base *EditBase `json:"base,omitempty"` +} + +// EditTitle represents a pull-request title change. +type EditTitle struct { + From *string `json:"from,omitempty"` +} + +// EditBody represents a change of pull-request body. +type EditBody struct { + From *string `json:"from,omitempty"` +} + +// EditBase represents the change of a pull-request base branch. +type EditBase struct { + Ref *EditRef `json:"ref,omitempty"` + SHA *EditSHA `json:"sha,omitempty"` +} + +// EditRef represents a ref change of a pull-request. +type EditRef struct { + From *string `json:"from,omitempty"` +} + +// EditSHA represents a sha change of a pull-request. +type EditSHA struct { + From *string `json:"from,omitempty"` } // ProjectChange represents the changes when a project has been edited. type ProjectChange struct { - Name *struct { - From *string `json:"from,omitempty"` - } `json:"name,omitempty"` - Body *struct { - From *string `json:"from,omitempty"` - } `json:"body,omitempty"` + Name *ProjectName `json:"name,omitempty"` + Body *ProjectBody `json:"body,omitempty"` +} + +// ProjectName represents a project name change. +type ProjectName struct { + From *string `json:"from,omitempty"` +} + +// ProjectBody represents a project body change. +type ProjectBody struct { + From *string `json:"from,omitempty"` } // ProjectCardChange represents the changes when a project card has been edited. type ProjectCardChange struct { - Note *struct { - From *string `json:"from,omitempty"` - } `json:"note,omitempty"` + Note *ProjectCardNote `json:"note,omitempty"` +} + +// ProjectCardNote represents a change of a note of a project card. +type ProjectCardNote struct { + From *string `json:"from,omitempty"` } // ProjectColumnChange represents the changes when a project column has been edited. type ProjectColumnChange struct { - Name *struct { - From *string `json:"from,omitempty"` - } `json:"name,omitempty"` + Name *ProjectColumnName `json:"name,omitempty"` +} + +// ProjectColumnName represents a project column name change. +type ProjectColumnName struct { + From *string `json:"from,omitempty"` } // TeamChange represents the changes when a team has been edited. type TeamChange struct { - Description *struct { - From *string `json:"from,omitempty"` - } `json:"description,omitempty"` - Name *struct { - From *string `json:"from,omitempty"` - } `json:"name,omitempty"` - Privacy *struct { - From *string `json:"from,omitempty"` - } `json:"privacy,omitempty"` - Repository *struct { - Permissions *struct { - From *struct { - Admin *bool `json:"admin,omitempty"` - Pull *bool `json:"pull,omitempty"` - Push *bool `json:"push,omitempty"` - } `json:"from,omitempty"` - } `json:"permissions,omitempty"` - } `json:"repository,omitempty"` + Description *TeamDescription `json:"description,omitempty"` + Name *TeamName `json:"name,omitempty"` + Privacy *TeamPrivacy `json:"privacy,omitempty"` + Repository *TeamRepository `json:"repository,omitempty"` +} + +// TeamDescription represents a team description change. +type TeamDescription struct { + From *string `json:"from,omitempty"` +} + +// TeamName represents a team name change. +type TeamName struct { + From *string `json:"from,omitempty"` +} + +// TeamPrivacy represents a team privacy change. +type TeamPrivacy struct { + From *string `json:"from,omitempty"` +} + +// TeamRepository represents a team repository permission change. +type TeamRepository struct { + Permissions *TeamPermissions `json:"permissions,omitempty"` +} + +// TeamPermissions represents a team permission change. +type TeamPermissions struct { + From *TeamPermissionsFrom `json:"from,omitempty"` +} + +// TeamPermissionsFrom represents a team permission change. +type TeamPermissionsFrom struct { + Admin *bool `json:"admin,omitempty"` + Pull *bool `json:"pull,omitempty"` + Push *bool `json:"push,omitempty"` } // InstallationEvent is triggered when a GitHub App has been installed, uninstalled, suspend, unsuspended @@ -890,22 +935,28 @@ type RepositoryVulnerabilityAlertEvent struct { Action *string `json:"action,omitempty"` //The security alert of the vulnerable dependency. - Alert *struct { - ID *int64 `json:"id,omitempty"` - AffectedRange *string `json:"affected_range,omitempty"` - AffectedPackageName *string `json:"affected_package_name,omitempty"` - ExternalReference *string `json:"external_reference,omitempty"` - ExternalIdentifier *string `json:"external_identifier,omitempty"` - FixedIn *string `json:"fixed_in,omitempty"` - Dismisser *User `json:"dismisser,omitempty"` - DismissReason *string `json:"dismiss_reason,omitempty"` - DismissedAt *Timestamp `json:"dismissed_at,omitempty"` - } `json:"alert,omitempty"` + Alert *RepositoryVulnerabilityAlert `json:"alert,omitempty"` //The repository of the vulnerable dependency. Repository *Repository `json:"repository,omitempty"` } +// RepositoryVulnerabilityAlert represents a repository security alert. +type RepositoryVulnerabilityAlert struct { + ID *int64 `json:"id,omitempty"` + AffectedRange *string `json:"affected_range,omitempty"` + AffectedPackageName *string `json:"affected_package_name,omitempty"` + ExternalReference *string `json:"external_reference,omitempty"` + ExternalIdentifier *string `json:"external_identifier,omitempty"` + GitHubSecurityAdvisoryID *string `json:"ghsa_id,omitempty"` + Severity *string `json:"severity,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + FixedIn *string `json:"fixed_in,omitempty"` + Dismisser *User `json:"dismisser,omitempty"` + DismissReason *string `json:"dismiss_reason,omitempty"` + DismissedAt *Timestamp `json:"dismissed_at,omitempty"` +} + // StarEvent is triggered when a star is added or removed from a repository. // The Webhook event name is "star". // diff --git a/vendor/github.com/google/go-github/v36/github/gists.go b/vendor/github.com/google/go-github/v37/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/gists.go rename to vendor/github.com/google/go-github/v37/github/gists.go diff --git a/vendor/github.com/google/go-github/v36/github/gists_comments.go b/vendor/github.com/google/go-github/v37/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/gists_comments.go rename to vendor/github.com/google/go-github/v37/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v36/github/git.go b/vendor/github.com/google/go-github/v37/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/git.go rename to vendor/github.com/google/go-github/v37/github/git.go diff --git a/vendor/github.com/google/go-github/v36/github/git_blobs.go b/vendor/github.com/google/go-github/v37/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/git_blobs.go rename to vendor/github.com/google/go-github/v37/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v36/github/git_commits.go b/vendor/github.com/google/go-github/v37/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/git_commits.go rename to vendor/github.com/google/go-github/v37/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v36/github/git_refs.go b/vendor/github.com/google/go-github/v37/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/git_refs.go rename to vendor/github.com/google/go-github/v37/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v36/github/git_tags.go b/vendor/github.com/google/go-github/v37/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/git_tags.go rename to vendor/github.com/google/go-github/v37/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v36/github/git_trees.go b/vendor/github.com/google/go-github/v37/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/git_trees.go rename to vendor/github.com/google/go-github/v37/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v36/github/github-accessors.go b/vendor/github.com/google/go-github/v37/github/github-accessors.go similarity index 97% rename from vendor/github.com/google/go-github/v36/github/github-accessors.go rename to vendor/github.com/google/go-github/v37/github/github-accessors.go index 1c17384eac..46efcc9c42 100644 --- a/vendor/github.com/google/go-github/v36/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v37/github/github-accessors.go @@ -212,12 +212,12 @@ func (a *Alert) GetRuleSeverity() string { return *a.RuleSeverity } -// GetTool returns the Tool field if it's non-nil, zero value otherwise. -func (a *Alert) GetTool() string { - if a == nil || a.Tool == nil { - return "" +// GetTool returns the Tool field. +func (a *Alert) GetTool() *Tool { + if a == nil { + return nil } - return *a.Tool + return a.Tool } // GetURL returns the URL field if it's non-nil, zero value otherwise. @@ -3620,6 +3620,78 @@ func (d *DraftReviewComment) GetStartSide() string { return *d.StartSide } +// GetRef returns the Ref field. +func (e *EditBase) GetRef() *EditRef { + if e == nil { + return nil + } + return e.Ref +} + +// GetSHA returns the SHA field. +func (e *EditBase) GetSHA() *EditSHA { + if e == nil { + return nil + } + return e.SHA +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (e *EditBody) GetFrom() string { + if e == nil || e.From == nil { + return "" + } + return *e.From +} + +// GetBase returns the Base field. +func (e *EditChange) GetBase() *EditBase { + if e == nil { + return nil + } + return e.Base +} + +// GetBody returns the Body field. +func (e *EditChange) GetBody() *EditBody { + if e == nil { + return nil + } + return e.Body +} + +// GetTitle returns the Title field. +func (e *EditChange) GetTitle() *EditTitle { + if e == nil { + return nil + } + return e.Title +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (e *EditRef) GetFrom() string { + if e == nil || e.From == nil { + return "" + } + return *e.From +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (e *EditSHA) GetFrom() string { + if e == nil || e.From == nil { + return "" + } + return *e.From +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (e *EditTitle) GetFrom() string { + if e == nil || e.From == nil { + return "" + } + return *e.From +} + // GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. func (e *Enterprise) GetAvatarURL() string { if e == nil || e.AvatarURL == nil { @@ -3820,6 +3892,22 @@ func (e *EnvReviewers) GetType() string { return *e.Type } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (e *ErrorBlock) GetCreatedAt() Timestamp { + if e == nil || e.CreatedAt == nil { + return Timestamp{} + } + return *e.CreatedAt +} + +// GetBlock returns the Block field. +func (e *ErrorResponse) GetBlock() *ErrorBlock { + if e == nil { + return nil + } + return e.Block +} + // GetActor returns the Actor field. func (e *Event) GetActor() *User { if e == nil { @@ -3900,6 +3988,54 @@ func (f *FeedLink) GetType() string { return *f.Type } +// GetCurrentUser returns the CurrentUser field. +func (f *FeedLinks) GetCurrentUser() *FeedLink { + if f == nil { + return nil + } + return f.CurrentUser +} + +// GetCurrentUserActor returns the CurrentUserActor field. +func (f *FeedLinks) GetCurrentUserActor() *FeedLink { + if f == nil { + return nil + } + return f.CurrentUserActor +} + +// GetCurrentUserOrganization returns the CurrentUserOrganization field. +func (f *FeedLinks) GetCurrentUserOrganization() *FeedLink { + if f == nil { + return nil + } + return f.CurrentUserOrganization +} + +// GetCurrentUserPublic returns the CurrentUserPublic field. +func (f *FeedLinks) GetCurrentUserPublic() *FeedLink { + if f == nil { + return nil + } + return f.CurrentUserPublic +} + +// GetTimeline returns the Timeline field. +func (f *FeedLinks) GetTimeline() *FeedLink { + if f == nil { + return nil + } + return f.Timeline +} + +// GetUser returns the User field. +func (f *FeedLinks) GetUser() *FeedLink { + if f == nil { + return nil + } + return f.User +} + // GetCurrentUserActorURL returns the CurrentUserActorURL field if it's non-nil, zero value otherwise. func (f *Feeds) GetCurrentUserActorURL() string { if f == nil || f.CurrentUserActorURL == nil { @@ -3932,6 +4068,14 @@ func (f *Feeds) GetCurrentUserURL() string { return *f.CurrentUserURL } +// GetLinks returns the Links field. +func (f *Feeds) GetLinks() *FeedLinks { + if f == nil { + return nil + } + return f.Links +} + // GetTimelineURL returns the TimelineURL field if it's non-nil, zero value otherwise. func (f *Feeds) GetTimelineURL() string { if f == nil || f.TimelineURL == nil { @@ -9316,6 +9460,14 @@ func (p *Project) GetURL() string { return *p.URL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectBody) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + // GetArchived returns the Archived field if it's non-nil, zero value otherwise. func (p *ProjectCard) GetArchived() bool { if p == nil || p.Archived == nil { @@ -9436,6 +9588,14 @@ func (p *ProjectCard) GetURL() string { return *p.URL } +// GetNote returns the Note field. +func (p *ProjectCardChange) GetNote() *ProjectCardNote { + if p == nil { + return nil + } + return p.Note +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *ProjectCardEvent) GetAction() string { if p == nil || p.Action == nil { @@ -9508,6 +9668,14 @@ func (p *ProjectCardListOptions) GetArchivedState() string { return *p.ArchivedState } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectCardNote) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + // GetArchived returns the Archived field if it's non-nil, zero value otherwise. func (p *ProjectCardOptions) GetArchived() bool { if p == nil || p.Archived == nil { @@ -9516,6 +9684,22 @@ func (p *ProjectCardOptions) GetArchived() bool { return *p.Archived } +// GetBody returns the Body field. +func (p *ProjectChange) GetBody() *ProjectBody { + if p == nil { + return nil + } + return p.Body +} + +// GetName returns the Name field. +func (p *ProjectChange) GetName() *ProjectName { + if p == nil { + return nil + } + return p.Name +} + // GetPermission returns the Permission field if it's non-nil, zero value otherwise. func (p *ProjectCollaboratorOptions) GetPermission() string { if p == nil || p.Permission == nil { @@ -9588,6 +9772,14 @@ func (p *ProjectColumn) GetURL() string { return *p.URL } +// GetName returns the Name field. +func (p *ProjectColumnChange) GetName() *ProjectColumnName { + if p == nil { + return nil + } + return p.Name +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *ProjectColumnEvent) GetAction() string { if p == nil || p.Action == nil { @@ -9652,6 +9844,14 @@ func (p *ProjectColumnEvent) GetSender() *User { return p.Sender } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectColumnName) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *ProjectEvent) GetAction() string { if p == nil || p.Action == nil { @@ -9708,6 +9908,14 @@ func (p *ProjectEvent) GetSender() *User { return p.Sender } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (p *ProjectName) GetFrom() string { + if p == nil || p.From == nil { + return "" + } + return *p.From +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (p *ProjectOptions) GetBody() string { if p == nil || p.Body == nil { @@ -9788,6 +9996,14 @@ func (p *Protection) GetEnforceAdmins() *AdminEnforcement { return p.EnforceAdmins } +// GetRequiredConversationResolution returns the RequiredConversationResolution field. +func (p *Protection) GetRequiredConversationResolution() *RequiredConversationResolution { + if p == nil { + return nil + } + return p.RequiredConversationResolution +} + // GetRequiredPullRequestReviews returns the RequiredPullRequestReviews field. func (p *Protection) GetRequiredPullRequestReviews() *PullRequestReviewsEnforcement { if p == nil { @@ -9972,6 +10188,14 @@ func (p *PullRequest) GetAuthorAssociation() string { return *p.AuthorAssociation } +// GetAutoMerge returns the AutoMerge field. +func (p *PullRequest) GetAutoMerge() *PullRequestAutoMerge { + if p == nil { + return nil + } + return p.AutoMerge +} + // GetBase returns the Base field. func (p *PullRequest) GetBase() *PullRequestBranch { if p == nil { @@ -10284,6 +10508,38 @@ func (p *PullRequest) GetUser() *User { return p.User } +// GetCommitMessage returns the CommitMessage field if it's non-nil, zero value otherwise. +func (p *PullRequestAutoMerge) GetCommitMessage() string { + if p == nil || p.CommitMessage == nil { + return "" + } + return *p.CommitMessage +} + +// GetCommitTitle returns the CommitTitle field if it's non-nil, zero value otherwise. +func (p *PullRequestAutoMerge) GetCommitTitle() string { + if p == nil || p.CommitTitle == nil { + return "" + } + return *p.CommitTitle +} + +// GetEnabledBy returns the EnabledBy field. +func (p *PullRequestAutoMerge) GetEnabledBy() *User { + if p == nil { + return nil + } + return p.EnabledBy +} + +// GetMergeMethod returns the MergeMethod field if it's non-nil, zero value otherwise. +func (p *PullRequestAutoMerge) GetMergeMethod() string { + if p == nil || p.MergeMethod == nil { + return "" + } + return *p.MergeMethod +} + // GetLabel returns the Label field if it's non-nil, zero value otherwise. func (p *PullRequestBranch) GetLabel() string { if p == nil || p.Label == nil { @@ -12460,6 +12716,14 @@ func (r *Repository) GetNotificationsURL() string { return *r.NotificationsURL } +// GetOpenIssues returns the OpenIssues field if it's non-nil, zero value otherwise. +func (r *Repository) GetOpenIssues() int { + if r == nil || r.OpenIssues == nil { + return 0 + } + return *r.OpenIssues +} + // GetOpenIssuesCount returns the OpenIssuesCount field if it's non-nil, zero value otherwise. func (r *Repository) GetOpenIssuesCount() int { if r == nil || r.OpenIssuesCount == nil { @@ -12676,6 +12940,14 @@ func (r *Repository) GetVisibility() string { return *r.Visibility } +// GetWatchers returns the Watchers field if it's non-nil, zero value otherwise. +func (r *Repository) GetWatchers() int { + if r == nil || r.Watchers == nil { + return 0 + } + return *r.Watchers +} + // GetWatchersCount returns the WatchersCount field if it's non-nil, zero value otherwise. func (r *Repository) GetWatchersCount() int { if r == nil || r.WatchersCount == nil { @@ -13452,6 +13724,102 @@ func (r *RepositoryTag) GetZipballURL() string { return *r.ZipballURL } +// GetAffectedPackageName returns the AffectedPackageName field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetAffectedPackageName() string { + if r == nil || r.AffectedPackageName == nil { + return "" + } + return *r.AffectedPackageName +} + +// GetAffectedRange returns the AffectedRange field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetAffectedRange() string { + if r == nil || r.AffectedRange == nil { + return "" + } + return *r.AffectedRange +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + +// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetDismissedAt() Timestamp { + if r == nil || r.DismissedAt == nil { + return Timestamp{} + } + return *r.DismissedAt +} + +// GetDismisser returns the Dismisser field. +func (r *RepositoryVulnerabilityAlert) GetDismisser() *User { + if r == nil { + return nil + } + return r.Dismisser +} + +// GetDismissReason returns the DismissReason field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetDismissReason() string { + if r == nil || r.DismissReason == nil { + return "" + } + return *r.DismissReason +} + +// GetExternalIdentifier returns the ExternalIdentifier field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetExternalIdentifier() string { + if r == nil || r.ExternalIdentifier == nil { + return "" + } + return *r.ExternalIdentifier +} + +// GetExternalReference returns the ExternalReference field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetExternalReference() string { + if r == nil || r.ExternalReference == nil { + return "" + } + return *r.ExternalReference +} + +// GetFixedIn returns the FixedIn field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetFixedIn() string { + if r == nil || r.FixedIn == nil { + return "" + } + return *r.FixedIn +} + +// GetGitHubSecurityAdvisoryID returns the GitHubSecurityAdvisoryID field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetGitHubSecurityAdvisoryID() string { + if r == nil || r.GitHubSecurityAdvisoryID == nil { + return "" + } + return *r.GitHubSecurityAdvisoryID +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (r *RepositoryVulnerabilityAlert) GetSeverity() string { + if r == nil || r.Severity == nil { + return "" + } + return *r.Severity +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (r *RepositoryVulnerabilityAlertEvent) GetAction() string { if r == nil || r.Action == nil { @@ -13460,6 +13828,14 @@ func (r *RepositoryVulnerabilityAlertEvent) GetAction() string { return *r.Action } +// GetAlert returns the Alert field. +func (r *RepositoryVulnerabilityAlertEvent) GetAlert() *RepositoryVulnerabilityAlert { + if r == nil { + return nil + } + return r.Alert +} + // GetRepository returns the Repository field. func (r *RepositoryVulnerabilityAlertEvent) GetRepository() *Repository { if r == nil { @@ -14468,6 +14844,46 @@ func (t *TeamAddEvent) GetTeam() *Team { return t.Team } +// GetDescription returns the Description field. +func (t *TeamChange) GetDescription() *TeamDescription { + if t == nil { + return nil + } + return t.Description +} + +// GetName returns the Name field. +func (t *TeamChange) GetName() *TeamName { + if t == nil { + return nil + } + return t.Name +} + +// GetPrivacy returns the Privacy field. +func (t *TeamChange) GetPrivacy() *TeamPrivacy { + if t == nil { + return nil + } + return t.Privacy +} + +// GetRepository returns the Repository field. +func (t *TeamChange) GetRepository() *TeamRepository { + if t == nil { + return nil + } + return t.Repository +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (t *TeamDescription) GetFrom() string { + if t == nil || t.From == nil { + return "" + } + return *t.From +} + // GetAuthor returns the Author field. func (t *TeamDiscussion) GetAuthor() *User { if t == nil { @@ -14748,6 +15164,54 @@ func (t *TeamLDAPMapping) GetURL() string { return *t.URL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (t *TeamName) GetFrom() string { + if t == nil || t.From == nil { + return "" + } + return *t.From +} + +// GetFrom returns the From field. +func (t *TeamPermissions) GetFrom() *TeamPermissionsFrom { + if t == nil { + return nil + } + return t.From +} + +// GetAdmin returns the Admin field if it's non-nil, zero value otherwise. +func (t *TeamPermissionsFrom) GetAdmin() bool { + if t == nil || t.Admin == nil { + return false + } + return *t.Admin +} + +// GetPull returns the Pull field if it's non-nil, zero value otherwise. +func (t *TeamPermissionsFrom) GetPull() bool { + if t == nil || t.Pull == nil { + return false + } + return *t.Pull +} + +// GetPush returns the Push field if it's non-nil, zero value otherwise. +func (t *TeamPermissionsFrom) GetPush() bool { + if t == nil || t.Push == nil { + return false + } + return *t.Push +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (t *TeamPrivacy) GetFrom() string { + if t == nil || t.From == nil { + return "" + } + return *t.From +} + // GetPermission returns the Permission field if it's non-nil, zero value otherwise. func (t *TeamProjectOptions) GetPermission() string { if t == nil || t.Permission == nil { @@ -14756,6 +15220,14 @@ func (t *TeamProjectOptions) GetPermission() string { return *t.Permission } +// GetPermissions returns the Permissions field. +func (t *TeamRepository) GetPermissions() *TeamPermissions { + if t == nil { + return nil + } + return t.Permissions +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (t *TemplateRepoRequest) GetDescription() string { if t == nil || t.Description == nil { @@ -14924,6 +15396,14 @@ func (t *Timeline) GetSource() *Source { return t.Source } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (t *Timeline) GetState() string { + if t == nil || t.State == nil { + return "" + } + return *t.State +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (t *Timeline) GetURL() string { if t == nil || t.URL == nil { @@ -14932,6 +15412,30 @@ func (t *Timeline) GetURL() string { return *t.URL } +// GetGUID returns the GUID field if it's non-nil, zero value otherwise. +func (t *Tool) GetGUID() string { + if t == nil || t.GUID == nil { + return "" + } + return *t.GUID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (t *Tool) GetName() string { + if t == nil || t.Name == nil { + return "" + } + return *t.Name +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (t *Tool) GetVersion() string { + if t == nil || t.Version == nil { + return "" + } + return *t.Version +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (t *TopicResult) GetCreatedAt() Timestamp { if t == nil || t.CreatedAt == nil { diff --git a/vendor/github.com/google/go-github/v36/github/github.go b/vendor/github.com/google/go-github/v37/github/github.go similarity index 97% rename from vendor/github.com/google/go-github/v36/github/github.go rename to vendor/github.com/google/go-github/v37/github/github.go index efde8f8dba..264e27f476 100644 --- a/vendor/github.com/google/go-github/v36/github/github.go +++ b/vendor/github.com/google/go-github/v37/github/github.go @@ -522,6 +522,12 @@ func parseRate(r *http.Response) Rate { return rate } +type requestContext uint8 + +const ( + bypassRateLimitCheck requestContext = iota +) + // BareDo sends an API request and lets you handle the api response. If an error // or API Error occurs, the error will contain more information. Otherwise you // are supposed to read and close the response's Body. If rate limit is exceeded @@ -538,12 +544,14 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro rateLimitCategory := category(req.URL.Path) - // If we've hit rate limit, don't make further requests before Reset time. - if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { - return &Response{ - Response: err.Response, - Rate: err.Rate, - }, err + if bypass := ctx.Value(bypassRateLimitCheck); bypass == nil { + // If we've hit rate limit, don't make further requests before Reset time. + if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { + return &Response{ + Response: err.Response, + Rate: err.Rate, + }, err + } } resp, err := c.client.Do(req) @@ -679,18 +687,21 @@ type ErrorResponse struct { Message string `json:"message"` // error message Errors []Error `json:"errors"` // more detail on individual errors // Block is only populated on certain types of errors such as code 451. - // See https://developer.github.com/changes/2016-03-17-the-451-status-code-is-now-supported/ - // for more information. - Block *struct { - Reason string `json:"reason,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - } `json:"block,omitempty"` + Block *ErrorBlock `json:"block,omitempty"` // Most errors will also include a documentation_url field pointing // to some content that might help you resolve the error, see // https://docs.github.com/en/free-pro-team@latest/rest/reference/#client-errors DocumentationURL string `json:"documentation_url,omitempty"` } +// ErrorBlock contains a further explanation for the reason of an error. +// See https://developer.github.com/changes/2016-03-17-the-451-status-code-is-now-supported/ +// for more information. +type ErrorBlock struct { + Reason string `json:"reason,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` +} + func (r *ErrorResponse) Error() string { return fmt.Sprintf("%v %v: %d %v %+v", r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), @@ -1022,6 +1033,9 @@ func (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) response := new(struct { Resources *RateLimits `json:"resources"` }) + + // This resource is not subject to rate limits. + ctx = context.WithValue(ctx, bypassRateLimitCheck, true) resp, err := c.Do(ctx, req, response) if err != nil { return nil, resp, err diff --git a/vendor/github.com/google/go-github/v36/github/gitignore.go b/vendor/github.com/google/go-github/v37/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/gitignore.go rename to vendor/github.com/google/go-github/v37/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v36/github/interactions.go b/vendor/github.com/google/go-github/v37/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/interactions.go rename to vendor/github.com/google/go-github/v37/github/interactions.go diff --git a/vendor/github.com/google/go-github/v36/github/interactions_orgs.go b/vendor/github.com/google/go-github/v37/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v37/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v36/github/interactions_repos.go b/vendor/github.com/google/go-github/v37/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/interactions_repos.go rename to vendor/github.com/google/go-github/v37/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v36/github/issue_import.go b/vendor/github.com/google/go-github/v37/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issue_import.go rename to vendor/github.com/google/go-github/v37/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v36/github/issues.go b/vendor/github.com/google/go-github/v37/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issues.go rename to vendor/github.com/google/go-github/v37/github/issues.go diff --git a/vendor/github.com/google/go-github/v36/github/issues_assignees.go b/vendor/github.com/google/go-github/v37/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issues_assignees.go rename to vendor/github.com/google/go-github/v37/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v36/github/issues_comments.go b/vendor/github.com/google/go-github/v37/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issues_comments.go rename to vendor/github.com/google/go-github/v37/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v36/github/issues_events.go b/vendor/github.com/google/go-github/v37/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issues_events.go rename to vendor/github.com/google/go-github/v37/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v36/github/issues_labels.go b/vendor/github.com/google/go-github/v37/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issues_labels.go rename to vendor/github.com/google/go-github/v37/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v36/github/issues_milestones.go b/vendor/github.com/google/go-github/v37/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/issues_milestones.go rename to vendor/github.com/google/go-github/v37/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v36/github/issues_timeline.go b/vendor/github.com/google/go-github/v37/github/issues_timeline.go similarity index 95% rename from vendor/github.com/google/go-github/v36/github/issues_timeline.go rename to vendor/github.com/google/go-github/v37/github/issues_timeline.go index 2033a7237b..1fd13b128c 100644 --- a/vendor/github.com/google/go-github/v36/github/issues_timeline.go +++ b/vendor/github.com/google/go-github/v37/github/issues_timeline.go @@ -81,6 +81,9 @@ type Timeline struct { // reopened // The issue was reopened by the actor. // + // reviewed + // The pull request was reviewed. + // // subscribed // The actor subscribed to receive notifications for an issue. // @@ -118,6 +121,10 @@ type Timeline struct { // Only provided for 'renamed' events. Rename *Rename `json:"rename,omitempty"` ProjectCard *ProjectCard `json:"project_card,omitempty"` + // The state of a submitted review. Can be one of: 'commented', + // 'changes_requested' or 'approved'. + // Only provided for 'reviewed' events. + State *string `json:"state,omitempty"` } // Source represents a reference's source. diff --git a/vendor/github.com/google/go-github/v36/github/licenses.go b/vendor/github.com/google/go-github/v37/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/licenses.go rename to vendor/github.com/google/go-github/v37/github/licenses.go diff --git a/vendor/github.com/google/go-github/v36/github/messages.go b/vendor/github.com/google/go-github/v37/github/messages.go similarity index 98% rename from vendor/github.com/google/go-github/v36/github/messages.go rename to vendor/github.com/google/go-github/v37/github/messages.go index 98a76da644..06ea9e4cfe 100644 --- a/vendor/github.com/google/go-github/v36/github/messages.go +++ b/vendor/github.com/google/go-github/v37/github/messages.go @@ -19,6 +19,7 @@ import ( "fmt" "hash" "io/ioutil" + "mime" "net/http" "net/url" "strings" @@ -157,7 +158,14 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { var body []byte // Raw body that GitHub uses to calculate the signature. - switch ct := r.Header.Get("Content-Type"); ct { + ct := r.Header.Get("Content-Type") + + mediatype, _, err := mime.ParseMediaType(ct) + if err != nil { + mediatype = "" + } + + switch mediatype { case "application/json": var err error if body, err = ioutil.ReadAll(r.Body); err != nil { diff --git a/vendor/github.com/google/go-github/v36/github/migrations.go b/vendor/github.com/google/go-github/v37/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/migrations.go rename to vendor/github.com/google/go-github/v37/github/migrations.go diff --git a/vendor/github.com/google/go-github/v36/github/migrations_source_import.go b/vendor/github.com/google/go-github/v37/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v37/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v36/github/migrations_user.go b/vendor/github.com/google/go-github/v37/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/migrations_user.go rename to vendor/github.com/google/go-github/v37/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v36/github/misc.go b/vendor/github.com/google/go-github/v37/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/misc.go rename to vendor/github.com/google/go-github/v37/github/misc.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs.go b/vendor/github.com/google/go-github/v37/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs.go rename to vendor/github.com/google/go-github/v37/github/orgs.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v37/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v37/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v37/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v37/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v37/github/orgs_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v37/github/orgs_audit_log.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_hooks.go b/vendor/github.com/google/go-github/v37/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v37/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_members.go b/vendor/github.com/google/go-github/v37/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_members.go rename to vendor/github.com/google/go-github/v37/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v37/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v37/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_projects.go b/vendor/github.com/google/go-github/v37/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_projects.go rename to vendor/github.com/google/go-github/v37/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v36/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v37/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v37/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v36/github/packages.go b/vendor/github.com/google/go-github/v37/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/packages.go rename to vendor/github.com/google/go-github/v37/github/packages.go diff --git a/vendor/github.com/google/go-github/v36/github/projects.go b/vendor/github.com/google/go-github/v37/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/projects.go rename to vendor/github.com/google/go-github/v37/github/projects.go diff --git a/vendor/github.com/google/go-github/v36/github/pulls.go b/vendor/github.com/google/go-github/v37/github/pulls.go similarity index 81% rename from vendor/github.com/google/go-github/v36/github/pulls.go rename to vendor/github.com/google/go-github/v37/github/pulls.go index 0b48c232a6..6c866ea884 100644 --- a/vendor/github.com/google/go-github/v36/github/pulls.go +++ b/vendor/github.com/google/go-github/v37/github/pulls.go @@ -18,50 +18,59 @@ import ( // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls/ type PullRequestsService service +// PullRequestAutoMerge represents the "auto_merge" response for a PullRequest. +type PullRequestAutoMerge struct { + EnabledBy *User `json:"enabled_by,omitempty"` + MergeMethod *string `json:"merge_method,omitempty"` + CommitTitle *string `json:"commit_title,omitempty"` + CommitMessage *string `json:"commit_message,omitempty"` +} + // PullRequest represents a GitHub pull request on a repository. type PullRequest struct { - ID *int64 `json:"id,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - Locked *bool `json:"locked,omitempty"` - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` - CreatedAt *time.Time `json:"created_at,omitempty"` - UpdatedAt *time.Time `json:"updated_at,omitempty"` - ClosedAt *time.Time `json:"closed_at,omitempty"` - MergedAt *time.Time `json:"merged_at,omitempty"` - Labels []*Label `json:"labels,omitempty"` - User *User `json:"user,omitempty"` - Draft *bool `json:"draft,omitempty"` - Merged *bool `json:"merged,omitempty"` - Mergeable *bool `json:"mergeable,omitempty"` - MergeableState *string `json:"mergeable_state,omitempty"` - MergedBy *User `json:"merged_by,omitempty"` - MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` - Rebaseable *bool `json:"rebaseable,omitempty"` - Comments *int `json:"comments,omitempty"` - Commits *int `json:"commits,omitempty"` - Additions *int `json:"additions,omitempty"` - Deletions *int `json:"deletions,omitempty"` - ChangedFiles *int `json:"changed_files,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - IssueURL *string `json:"issue_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - DiffURL *string `json:"diff_url,omitempty"` - PatchURL *string `json:"patch_url,omitempty"` - CommitsURL *string `json:"commits_url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - ReviewCommentsURL *string `json:"review_comments_url,omitempty"` - ReviewCommentURL *string `json:"review_comment_url,omitempty"` - ReviewComments *int `json:"review_comments,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Assignees []*User `json:"assignees,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` - MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"` - AuthorAssociation *string `json:"author_association,omitempty"` - NodeID *string `json:"node_id,omitempty"` - RequestedReviewers []*User `json:"requested_reviewers,omitempty"` + ID *int64 `json:"id,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + Locked *bool `json:"locked,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + ClosedAt *time.Time `json:"closed_at,omitempty"` + MergedAt *time.Time `json:"merged_at,omitempty"` + Labels []*Label `json:"labels,omitempty"` + User *User `json:"user,omitempty"` + Draft *bool `json:"draft,omitempty"` + Merged *bool `json:"merged,omitempty"` + Mergeable *bool `json:"mergeable,omitempty"` + MergeableState *string `json:"mergeable_state,omitempty"` + MergedBy *User `json:"merged_by,omitempty"` + MergeCommitSHA *string `json:"merge_commit_sha,omitempty"` + Rebaseable *bool `json:"rebaseable,omitempty"` + Comments *int `json:"comments,omitempty"` + Commits *int `json:"commits,omitempty"` + Additions *int `json:"additions,omitempty"` + Deletions *int `json:"deletions,omitempty"` + ChangedFiles *int `json:"changed_files,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + IssueURL *string `json:"issue_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + DiffURL *string `json:"diff_url,omitempty"` + PatchURL *string `json:"patch_url,omitempty"` + CommitsURL *string `json:"commits_url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + ReviewCommentsURL *string `json:"review_comments_url,omitempty"` + ReviewCommentURL *string `json:"review_comment_url,omitempty"` + ReviewComments *int `json:"review_comments,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assignees []*User `json:"assignees,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + MaintainerCanModify *bool `json:"maintainer_can_modify,omitempty"` + AuthorAssociation *string `json:"author_association,omitempty"` + NodeID *string `json:"node_id,omitempty"` + RequestedReviewers []*User `json:"requested_reviewers,omitempty"` + AutoMerge *PullRequestAutoMerge `json:"auto_merge,omitempty"` // RequestedTeams is populated as part of the PullRequestEvent. // See, https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pullrequestevent for an example. diff --git a/vendor/github.com/google/go-github/v36/github/pulls_comments.go b/vendor/github.com/google/go-github/v37/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/pulls_comments.go rename to vendor/github.com/google/go-github/v37/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v36/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v37/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v37/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v36/github/pulls_reviews.go b/vendor/github.com/google/go-github/v37/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v37/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v36/github/reactions.go b/vendor/github.com/google/go-github/v37/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/reactions.go rename to vendor/github.com/google/go-github/v37/github/reactions.go diff --git a/vendor/github.com/google/go-github/v36/github/repos.go b/vendor/github.com/google/go-github/v37/github/repos.go similarity index 95% rename from vendor/github.com/google/go-github/v36/github/repos.go rename to vendor/github.com/google/go-github/v37/github/repos.go index 8f34cf8b6d..d336e8bf77 100644 --- a/vendor/github.com/google/go-github/v36/github/repos.go +++ b/vendor/github.com/google/go-github/v37/github/repos.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "net/http" "strings" ) @@ -44,9 +45,11 @@ type Repository struct { ForksCount *int `json:"forks_count,omitempty"` NetworkCount *int `json:"network_count,omitempty"` OpenIssuesCount *int `json:"open_issues_count,omitempty"` + OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated. StargazersCount *int `json:"stargazers_count,omitempty"` SubscribersCount *int `json:"subscribers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated. + Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated. Size *int `json:"size,omitempty"` AutoInit *bool `json:"auto_init,omitempty"` Parent *Repository `json:"parent,omitempty"` @@ -751,13 +754,14 @@ type Branch struct { // Protection represents a repository branch's protection. type Protection struct { - RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` - RequiredPullRequestReviews *PullRequestReviewsEnforcement `json:"required_pull_request_reviews"` - EnforceAdmins *AdminEnforcement `json:"enforce_admins"` - Restrictions *BranchRestrictions `json:"restrictions"` - RequireLinearHistory *RequireLinearHistory `json:"required_linear_history"` - AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"` - AllowDeletions *AllowDeletions `json:"allow_deletions"` + RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` + RequiredPullRequestReviews *PullRequestReviewsEnforcement `json:"required_pull_request_reviews"` + EnforceAdmins *AdminEnforcement `json:"enforce_admins"` + Restrictions *BranchRestrictions `json:"restrictions"` + RequireLinearHistory *RequireLinearHistory `json:"required_linear_history"` + AllowForcePushes *AllowForcePushes `json:"allow_force_pushes"` + AllowDeletions *AllowDeletions `json:"allow_deletions"` + RequiredConversationResolution *RequiredConversationResolution `json:"required_conversation_resolution"` } // ProtectionRequest represents a request to create/edit a branch's protection. @@ -849,6 +853,11 @@ type AllowForcePushes struct { Enabled bool `json:"enabled"` } +// RequiredConversationResolution, if enabled, requires all comments on the pull request to be resolved before it can be merged to a protected branch. +type RequiredConversationResolution struct { + Enabled bool `json:"enabled"` +} + // AdminEnforcement represents the configuration to enforce required status checks for repository administrators. type AdminEnforcement struct { URL *string `json:"url,omitempty"` @@ -933,20 +942,49 @@ func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, re // GetBranch gets the specified branch for a repository. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-branch -func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string) (*Branch, *Response, error) { +func (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, followRedirects bool) (*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches/%v", owner, repo, branch) - req, err := s.client.NewRequest("GET", u, nil) + + resp, err := s.getBranchFromURL(ctx, u, followRedirects) if err != nil { return nil, nil, err } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) + } b := new(Branch) - resp, err := s.client.Do(ctx, req, b) + err = json.NewDecoder(resp.Body).Decode(b) + return b, newResponse(resp), err +} + +func (s *RepositoriesService) getBranchFromURL(ctx context.Context, u string, followRedirects bool) (*http.Response, error) { + req, err := s.client.NewRequest("GET", u, nil) if err != nil { - return nil, resp, err + return nil, err } - return b, resp, nil + var resp *http.Response + // Use http.DefaultTransport if no custom Transport is configured + req = withContext(ctx, req) + if s.client.client.Transport == nil { + resp, err = http.DefaultTransport.RoundTrip(req) + } else { + resp, err = s.client.client.Transport.RoundTrip(req) + } + if err != nil { + return nil, err + } + + // If redirect response is returned, follow it + if followRedirects && resp.StatusCode == http.StatusMovedPermanently { + resp.Body.Close() + u = resp.Header.Get("Location") + resp, err = s.getBranchFromURL(ctx, u, false) + } + return resp, err } // GetBranchProtection gets the protection of a given branch. diff --git a/vendor/github.com/google/go-github/v36/github/repos_collaborators.go b/vendor/github.com/google/go-github/v37/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v37/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_comments.go b/vendor/github.com/google/go-github/v37/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_comments.go rename to vendor/github.com/google/go-github/v37/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_commits.go b/vendor/github.com/google/go-github/v37/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_commits.go rename to vendor/github.com/google/go-github/v37/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_community_health.go b/vendor/github.com/google/go-github/v37/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_community_health.go rename to vendor/github.com/google/go-github/v37/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_contents.go b/vendor/github.com/google/go-github/v37/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_contents.go rename to vendor/github.com/google/go-github/v37/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_deployments.go b/vendor/github.com/google/go-github/v37/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_deployments.go rename to vendor/github.com/google/go-github/v37/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_environments.go b/vendor/github.com/google/go-github/v37/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_environments.go rename to vendor/github.com/google/go-github/v37/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_forks.go b/vendor/github.com/google/go-github/v37/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_forks.go rename to vendor/github.com/google/go-github/v37/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_hooks.go b/vendor/github.com/google/go-github/v37/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_hooks.go rename to vendor/github.com/google/go-github/v37/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_invitations.go b/vendor/github.com/google/go-github/v37/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_invitations.go rename to vendor/github.com/google/go-github/v37/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_keys.go b/vendor/github.com/google/go-github/v37/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_keys.go rename to vendor/github.com/google/go-github/v37/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_merging.go b/vendor/github.com/google/go-github/v37/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_merging.go rename to vendor/github.com/google/go-github/v37/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_pages.go b/vendor/github.com/google/go-github/v37/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_pages.go rename to vendor/github.com/google/go-github/v37/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v37/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v37/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_projects.go b/vendor/github.com/google/go-github/v37/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_projects.go rename to vendor/github.com/google/go-github/v37/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_releases.go b/vendor/github.com/google/go-github/v37/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_releases.go rename to vendor/github.com/google/go-github/v37/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_stats.go b/vendor/github.com/google/go-github/v37/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_stats.go rename to vendor/github.com/google/go-github/v37/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_statuses.go b/vendor/github.com/google/go-github/v37/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_statuses.go rename to vendor/github.com/google/go-github/v37/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v36/github/repos_traffic.go b/vendor/github.com/google/go-github/v37/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/repos_traffic.go rename to vendor/github.com/google/go-github/v37/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v36/github/search.go b/vendor/github.com/google/go-github/v37/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/search.go rename to vendor/github.com/google/go-github/v37/github/search.go diff --git a/vendor/github.com/google/go-github/v36/github/strings.go b/vendor/github.com/google/go-github/v37/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/strings.go rename to vendor/github.com/google/go-github/v37/github/strings.go diff --git a/vendor/github.com/google/go-github/v36/github/teams.go b/vendor/github.com/google/go-github/v37/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/teams.go rename to vendor/github.com/google/go-github/v37/github/teams.go diff --git a/vendor/github.com/google/go-github/v36/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v37/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v37/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v36/github/teams_discussions.go b/vendor/github.com/google/go-github/v37/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/teams_discussions.go rename to vendor/github.com/google/go-github/v37/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v36/github/teams_members.go b/vendor/github.com/google/go-github/v37/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/teams_members.go rename to vendor/github.com/google/go-github/v37/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v36/github/timestamp.go b/vendor/github.com/google/go-github/v37/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/timestamp.go rename to vendor/github.com/google/go-github/v37/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v36/github/users.go b/vendor/github.com/google/go-github/v37/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users.go rename to vendor/github.com/google/go-github/v37/github/users.go diff --git a/vendor/github.com/google/go-github/v36/github/users_administration.go b/vendor/github.com/google/go-github/v37/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_administration.go rename to vendor/github.com/google/go-github/v37/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v36/github/users_blocking.go b/vendor/github.com/google/go-github/v37/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_blocking.go rename to vendor/github.com/google/go-github/v37/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v36/github/users_emails.go b/vendor/github.com/google/go-github/v37/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_emails.go rename to vendor/github.com/google/go-github/v37/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v36/github/users_followers.go b/vendor/github.com/google/go-github/v37/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_followers.go rename to vendor/github.com/google/go-github/v37/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v36/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v37/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v37/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v36/github/users_keys.go b/vendor/github.com/google/go-github/v37/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_keys.go rename to vendor/github.com/google/go-github/v37/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v36/github/users_projects.go b/vendor/github.com/google/go-github/v37/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/users_projects.go rename to vendor/github.com/google/go-github/v37/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v36/github/with_appengine.go b/vendor/github.com/google/go-github/v37/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/with_appengine.go rename to vendor/github.com/google/go-github/v37/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v36/github/without_appengine.go b/vendor/github.com/google/go-github/v37/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v36/github/without_appengine.go rename to vendor/github.com/google/go-github/v37/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 26d6cf8c1c..d576df6b42 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -180,11 +180,9 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-github/v35 v35.1.0 +# github.com/google/go-github/v37 v37.0.0 ## explicit -# github.com/google/go-github/v36 v36.0.0 -## explicit -github.com/google/go-github/v36/github +github.com/google/go-github/v37/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/google/uuid v1.1.1