diff --git a/github/config.go b/github/config.go index 8c4b05bc1b..b1bb1e79f7 100644 --- a/github/config.go +++ b/github/config.go @@ -8,7 +8,7 @@ import ( "path" "time" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 94cac16c6c..06c5b25185 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/v45/github" + "github.com/google/go-github/v46/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 d2825373a3..d083a3a03a 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_external_groups.go b/github/data_source_github_external_groups.go index c174ab4fae..af295fd28c 100644 --- a/github/data_source_github_external_groups.go +++ b/github/data_source_github_external_groups.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index 585ea71138..279c5a461a 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -3,7 +3,7 @@ package github import ( "strconv" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 da9d1a6189..9750a8b254 100644 --- a/github/data_source_github_organization_team_sync_groups.go +++ b/github/data_source_github_organization_team_sync_groups.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_ref.go b/github/data_source_github_ref.go index d25bc78490..b978f7dff2 100644 --- a/github/data_source_github_ref.go +++ b/github/data_source_github_ref.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 2e8d0e0ea8..64e018506d 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 3e0769503d..9810b20cc1 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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.go b/github/data_source_github_repository.go index ddee5c99ab..7d4ed4332d 100644 --- a/github/data_source_github_repository.go +++ b/github/data_source_github_repository.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repository_file.go b/github/data_source_github_repository_file.go index 7e207e2f1a..4217081a72 100644 --- a/github/data_source_github_repository_file.go +++ b/github/data_source_github_repository_file.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index 9da5dfb300..a2b33f1aba 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/v45/github" + "github.com/google/go-github/v46/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 0e9280660e..707519d268 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -4,7 +4,7 @@ import ( "context" "strconv" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/shurcooL/githubv4" diff --git a/github/repository_utils.go b/github/repository_utils.go index d5709b9ffe..c58e68ead5 100644 --- a/github/repository_utils.go +++ b/github/repository_utils.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) // checkRepositoryBranchExists tests if a branch exists in a repository. diff --git a/github/resource_github_actions_environment_secret.go b/github/resource_github_actions_environment_secret.go index ef7a7be100..d6080c533b 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/v45/github" + "github.com/google/go-github/v46/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_permissions.go b/github/resource_github_actions_organization_permissions.go index 2546cca4af..0af74192fe 100644 --- a/github/resource_github_actions_organization_permissions.go +++ b/github/resource_github_actions_organization_permissions.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 0398d4aa00..9f7526d246 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/v45/github" + "github.com/google/go-github/v46/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_repositories.go b/github/resource_github_actions_organization_secret_repositories.go index ea34ff37df..e347c5acf5 100644 --- a/github/resource_github_actions_organization_secret_repositories.go +++ b/github/resource_github_actions_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_actions_runner_group.go b/github/resource_github_actions_runner_group.go index 40660bf532..b88d5b115a 100644 --- a/github/resource_github_actions_runner_group.go +++ b/github/resource_github_actions_runner_group.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 e165b01b0f..40992ffd62 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/v45/github" + "github.com/google/go-github/v46/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 dd8066d9d2..982c128ed7 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 8b8c4631a7..9a3d0731fa 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/v45/github" + "github.com/google/go-github/v46/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 7732f49e05..2906ad66ce 100644 --- a/github/resource_github_branch_default.go +++ b/github/resource_github_branch_default.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 87be07aa8f..00e750ef7a 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/v45/github" + "github.com/google/go-github/v46/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 bf0571e2e4..4e68a0fff9 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_dependabot_organization_secret.go b/github/resource_github_dependabot_organization_secret.go index 24e8e26ead..70a697d817 100644 --- a/github/resource_github_dependabot_organization_secret.go +++ b/github/resource_github_dependabot_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) @@ -89,13 +89,13 @@ func resourceGithubDependabotOrganizationSecretCreateOrUpdate(d *schema.Resource return fmt.Errorf("Cannot use selected_repository_ids without visibility being set to selected") } - selectedRepositoryIDs := []int64{} + selectedRepositoryIDs := []string{} if hasSelectedRepositories { ids := selectedRepositories.(*schema.Set).List() for _, id := range ids { - selectedRepositoryIDs = append(selectedRepositoryIDs, int64(id.(int))) + selectedRepositoryIDs = append(selectedRepositoryIDs, id.(string)) } } @@ -114,8 +114,8 @@ func resourceGithubDependabotOrganizationSecretCreateOrUpdate(d *schema.Resource encryptedValue = base64.StdEncoding.EncodeToString(encryptedBytes) } - // Create an EncryptedSecret and encrypt the plaintext value into it - eSecret := &github.EncryptedSecret{ + // Create an DependabotEncryptedSecret and encrypt the plaintext value into it + eSecret := &github.DependabotEncryptedSecret{ Name: secretName, KeyID: keyId, Visibility: visibility, diff --git a/github/resource_github_dependabot_organization_secret_repositories.go b/github/resource_github_dependabot_organization_secret_repositories.go index c5de0d7d8b..d066126d01 100644 --- a/github/resource_github_dependabot_organization_secret_repositories.go +++ b/github/resource_github_dependabot_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -49,11 +49,11 @@ func resourceGithubDependabotOrganizationSecretRepositoriesCreateOrUpdate(d *sch secretName := d.Get("secret_name").(string) selectedRepositories := d.Get("selected_repository_ids") - selectedRepositoryIDs := []int64{} + selectedRepositoryIDs := []string{} ids := selectedRepositories.(*schema.Set).List() for _, id := range ids { - selectedRepositoryIDs = append(selectedRepositoryIDs, int64(id.(int))) + selectedRepositoryIDs = append(selectedRepositoryIDs, id.(string)) } _, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, owner, secretName, selectedRepositoryIDs) @@ -110,7 +110,7 @@ func resourceGithubDependabotOrganizationSecretRepositoriesDelete(d *schema.Reso return err } - selectedRepositoryIDs := []int64{} + selectedRepositoryIDs := []string{} _, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, owner, d.Id(), selectedRepositoryIDs) if err != nil { return err diff --git a/github/resource_github_dependabot_secret.go b/github/resource_github_dependabot_secret.go index c0c7ad136d..b6710a9847 100644 --- a/github/resource_github_dependabot_secret.go +++ b/github/resource_github_dependabot_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "golang.org/x/crypto/nacl/box" ) @@ -81,8 +81,8 @@ func resourceGithubDependabotSecretCreateOrUpdate(d *schema.ResourceData, meta i encryptedValue = base64.StdEncoding.EncodeToString(encryptedBytes) } - // Create an EncryptedSecret and encrypt the plaintext value into it - eSecret := &github.EncryptedSecret{ + // Create an DependabotEncryptedSecret and encrypt the plaintext value into it + eSecret := &github.DependabotEncryptedSecret{ Name: secretName, KeyID: keyId, EncryptedValue: encryptedValue, diff --git a/github/resource_github_emu_group_mapping.go b/github/resource_github_emu_group_mapping.go index 9a6cbd0687..33a2dd33f9 100644 --- a/github/resource_github_emu_group_mapping.go +++ b/github/resource_github_emu_group_mapping.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_issue.go b/github/resource_github_issue.go index 9a92560ea0..0fe824a281 100644 --- a/github/resource_github_issue.go +++ b/github/resource_github_issue.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 123f639537..62c3a1a9bc 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 59cc2a5e35..5af66cf722 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/v45/github" + "github.com/google/go-github/v46/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 df66e93604..b3d8519340 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/v45/github" + "github.com/google/go-github/v46/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 382151ed84..6a179ee396 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/v45/github" + "github.com/google/go-github/v46/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 0a1ba1203b..22bdb45129 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/v45/github" + "github.com/google/go-github/v46/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 b819368dad..642e8655d4 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/v45/github" + "github.com/google/go-github/v46/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 412a86c42c..7fc7705f3c 100644 --- a/github/resource_github_project_card.go +++ b/github/resource_github_project_card.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 6833c98884..ee9d99a4c9 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/v45/github" + "github.com/google/go-github/v46/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 15f9429f48..6bb864fbed 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/v45/github" + "github.com/google/go-github/v46/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 948f9ffe95..691e7f9928 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) @@ -661,13 +661,14 @@ func expandPagesUpdate(input []interface{}) *github.PagesUpdate { // must include the branch name and optionally the subdirectory /docs. // e.g. "master" or "master /docs" pagesSource := pages["source"].([]interface{})[0].(map[string]interface{}) - source := pagesSource["branch"].(string) + sourceBranch := pagesSource["branch"].(string) + sourcePath := "" if v, ok := pagesSource["path"].(string); ok { if v != "" && v != "/" { - source += fmt.Sprintf(" %s", v) + sourcePath = v } } - update.Source = github.String(source) + update.Source = &github.PagesSource{Branch: &sourceBranch, Path: &sourcePath} return update } diff --git a/github/resource_github_repository_autolink_reference.go b/github/resource_github_repository_autolink_reference.go index 596bc568b6..277c00e394 100644 --- a/github/resource_github_repository_autolink_reference.go +++ b/github/resource_github_repository_autolink_reference.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 1ffa1f5523..133025528c 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/v45/github" + "github.com/google/go-github/v46/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 98f777410c..17472a817b 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/v45/github" + "github.com/google/go-github/v46/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 64b046dc80..819b26968c 100644 --- a/github/resource_github_repository_environment.go +++ b/github/resource_github_repository_environment.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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 5f72cf0dd8..f0d91e7c7d 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -7,7 +7,7 @@ import ( "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index 0235097bb0..249f5bb565 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/v45/github" + "github.com/google/go-github/v46/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 138dfa2bd1..d0768b7931 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/v45/github" + "github.com/google/go-github/v46/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 6fabb90686..f28d65297a 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/v45/github" + "github.com/google/go-github/v46/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 3df9ca7f89..cadb74f530 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 89ffbae605..d19ce59916 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/v45/github" + "github.com/google/go-github/v46/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_members.go b/github/resource_github_team_members.go index a047730df6..033fb51fd3 100644 --- a/github/resource_github_team_members.go +++ b/github/resource_github_team_members.go @@ -6,7 +6,7 @@ import ( "reflect" "strconv" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_members_test.go b/github/resource_github_team_members_test.go index 97711e71ed..f5e8fd4970 100644 --- a/github/resource_github_team_members_test.go +++ b/github/resource_github_team_members_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/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_membership.go b/github/resource_github_team_membership.go index 624d74ae43..dc0c0b1253 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/v45/github" + "github.com/google/go-github/v46/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 fa13109922..e84043924b 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/v45/github" + "github.com/google/go-github/v46/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 447ca307cc..05d94bfd6d 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/v45/github" + "github.com/google/go-github/v46/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 a7e6c5e7ba..a583b310d3 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/v45/github" + "github.com/google/go-github/v46/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 c605f56180..3b5240a831 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index f0a6176e60..a2e6c6531b 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/v45/github" + "github.com/google/go-github/v46/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 d682d252a0..1f03b04e86 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index fd35ed3c73..dbe190312a 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/v45/github" + "github.com/google/go-github/v46/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 3a869906ba..cf02699b9e 100644 --- a/github/transport.go +++ b/github/transport.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index f80b634f8b..a4a9967250 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index 399c693c46..c8620df6ce 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v45/github" + "github.com/google/go-github/v46/github" ) const ( diff --git a/go.mod b/go.mod index 35abc3972f..3fb3578fe5 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/v45 v45.2.0 + github.com/google/go-github/v46 v46.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 85226c2e3b..fd3d863946 100644 --- a/go.sum +++ b/go.sum @@ -157,8 +157,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI= -github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= +github.com/google/go-github/v46 v46.0.0 h1:5TZiEw0Is5D9CPld0TSLPjShGr42L7PoyhUSl6KPMKM= +github.com/google/go-github/v46 v46.0.0/go.mod h1:l+/Ml209okuXUAjbvFnGZ2ntokVAhTtXvYWP8Di7OpU= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= diff --git a/vendor/github.com/google/go-github/v45/AUTHORS b/vendor/github.com/google/go-github/v46/AUTHORS similarity index 100% rename from vendor/github.com/google/go-github/v45/AUTHORS rename to vendor/github.com/google/go-github/v46/AUTHORS diff --git a/vendor/github.com/google/go-github/v45/LICENSE b/vendor/github.com/google/go-github/v46/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v45/LICENSE rename to vendor/github.com/google/go-github/v46/LICENSE diff --git a/vendor/github.com/google/go-github/v45/github/actions.go b/vendor/github.com/google/go-github/v46/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/actions.go rename to vendor/github.com/google/go-github/v46/github/actions.go diff --git a/vendor/github.com/google/go-github/v45/github/actions_artifacts.go b/vendor/github.com/google/go-github/v46/github/actions_artifacts.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v46/github/actions_artifacts.go diff --git a/vendor/github.com/google/go-github/v45/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v46/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v46/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v45/github/actions_runners.go b/vendor/github.com/google/go-github/v46/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/actions_runners.go rename to vendor/github.com/google/go-github/v46/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v45/github/actions_secrets.go b/vendor/github.com/google/go-github/v46/github/actions_secrets.go similarity index 99% rename from vendor/github.com/google/go-github/v45/github/actions_secrets.go rename to vendor/github.com/google/go-github/v46/github/actions_secrets.go index dc057edba2..316badb70d 100644 --- a/vendor/github.com/google/go-github/v45/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v46/github/actions_secrets.go @@ -186,7 +186,7 @@ func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secr return s.getSecret(ctx, url) } -// SelectedRepoIDs are the repository IDs that have access to the secret. +// SelectedRepoIDs are the repository IDs that have access to the actions secrets. type SelectedRepoIDs []int64 // EncryptedSecret represents a secret that is encrypted using a public key. diff --git a/vendor/github.com/google/go-github/v45/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v46/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v46/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v45/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v46/github/actions_workflow_runs.go similarity index 92% rename from vendor/github.com/google/go-github/v45/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v46/github/actions_workflow_runs.go index 18fdd57d6a..9fd01c4a56 100644 --- a/vendor/github.com/google/go-github/v45/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v46/github/actions_workflow_runs.go @@ -94,6 +94,14 @@ type WorkflowRunAttemptOptions struct { ExcludePullRequests *bool `url:"exclude_pull_requests,omitempty"` } +// PendingDeploymentsRequest specifies body parameters to PendingDeployments. +type PendingDeploymentsRequest struct { + EnvironmentIDs []int64 `json:"environment_ids"` + // State can be one of: "approved", "rejected". + State string `json:"state"` + Comment string `json:"comment"` +} + func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u, err := addOptions(endpoint, opts) if err != nil { @@ -321,3 +329,23 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep return workflowRunUsage, resp, nil } + +// PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. +// +// GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + var deployments []*Deployment + resp, err := s.client.Do(ctx, req, &deployments) + if err != nil { + return nil, resp, err + } + + return deployments, resp, nil +} diff --git a/vendor/github.com/google/go-github/v45/github/actions_workflows.go b/vendor/github.com/google/go-github/v46/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/actions_workflows.go rename to vendor/github.com/google/go-github/v46/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v45/github/activity.go b/vendor/github.com/google/go-github/v46/github/activity.go similarity index 83% rename from vendor/github.com/google/go-github/v45/github/activity.go rename to vendor/github.com/google/go-github/v46/github/activity.go index f99ecfcdff..9cd9f9b71d 100644 --- a/vendor/github.com/google/go-github/v45/github/activity.go +++ b/vendor/github.com/google/go-github/v46/github/activity.go @@ -45,14 +45,15 @@ type FeedLinks struct { // ListFeeds lists all the feeds available to the authenticated user. // // GitHub provides several timeline resources in Atom format: -// Timeline: The GitHub global public timeline -// User: The public timeline for any user, using URI template -// Current user public: The public timeline for the authenticated user -// Current user: The private timeline for the authenticated user -// Current user actor: The private timeline for activity created by the -// authenticated user -// Current user organizations: The private timeline for the organizations -// the authenticated user is a member of. +// +// Timeline: The GitHub global public timeline +// User: The public timeline for any user, using URI template +// Current user public: The public timeline for the authenticated user +// Current user: The private timeline for the authenticated user +// Current user actor: The private timeline for activity created by the +// authenticated user +// Current user organizations: The private timeline for the organizations +// the authenticated user is a member of. // // Note: Private feeds are only returned when authenticating via Basic Auth // since current feed URIs use the older, non revocable auth tokens. diff --git a/vendor/github.com/google/go-github/v45/github/activity_events.go b/vendor/github.com/google/go-github/v46/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/activity_events.go rename to vendor/github.com/google/go-github/v46/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v45/github/activity_notifications.go b/vendor/github.com/google/go-github/v46/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/activity_notifications.go rename to vendor/github.com/google/go-github/v46/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v45/github/activity_star.go b/vendor/github.com/google/go-github/v46/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/activity_star.go rename to vendor/github.com/google/go-github/v46/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v45/github/activity_watching.go b/vendor/github.com/google/go-github/v46/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/activity_watching.go rename to vendor/github.com/google/go-github/v46/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v45/github/admin.go b/vendor/github.com/google/go-github/v46/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/admin.go rename to vendor/github.com/google/go-github/v46/github/admin.go diff --git a/vendor/github.com/google/go-github/v45/github/admin_orgs.go b/vendor/github.com/google/go-github/v46/github/admin_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/admin_orgs.go rename to vendor/github.com/google/go-github/v46/github/admin_orgs.go diff --git a/vendor/github.com/google/go-github/v45/github/admin_stats.go b/vendor/github.com/google/go-github/v46/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/admin_stats.go rename to vendor/github.com/google/go-github/v46/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v45/github/admin_users.go b/vendor/github.com/google/go-github/v46/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/admin_users.go rename to vendor/github.com/google/go-github/v46/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v45/github/apps.go b/vendor/github.com/google/go-github/v46/github/apps.go similarity index 98% rename from vendor/github.com/google/go-github/v45/github/apps.go rename to vendor/github.com/google/go-github/v46/github/apps.go index dff9b210f2..0e92f7b719 100644 --- a/vendor/github.com/google/go-github/v45/github/apps.go +++ b/vendor/github.com/google/go-github/v46/github/apps.go @@ -59,8 +59,9 @@ type InstallationTokenOptions struct { // InstallationPermissions lists the repository and organization permissions for an installation. // // Permission names taken from: -// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app -// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app +// +// https://docs.github.com/en/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app +// https://docs.github.com/en/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { Actions *string `json:"actions,omitempty"` Administration *string `json:"administration,omitempty"` diff --git a/vendor/github.com/google/go-github/v45/github/apps_hooks.go b/vendor/github.com/google/go-github/v46/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/apps_hooks.go rename to vendor/github.com/google/go-github/v46/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v45/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v46/github/apps_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v46/github/apps_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v45/github/apps_installation.go b/vendor/github.com/google/go-github/v46/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/apps_installation.go rename to vendor/github.com/google/go-github/v46/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v45/github/apps_manifest.go b/vendor/github.com/google/go-github/v46/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/apps_manifest.go rename to vendor/github.com/google/go-github/v46/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v45/github/apps_marketplace.go b/vendor/github.com/google/go-github/v46/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v46/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v45/github/authorizations.go b/vendor/github.com/google/go-github/v46/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/authorizations.go rename to vendor/github.com/google/go-github/v46/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v45/github/billing.go b/vendor/github.com/google/go-github/v46/github/billing.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/billing.go rename to vendor/github.com/google/go-github/v46/github/billing.go diff --git a/vendor/github.com/google/go-github/v45/github/checks.go b/vendor/github.com/google/go-github/v46/github/checks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/checks.go rename to vendor/github.com/google/go-github/v46/github/checks.go diff --git a/vendor/github.com/google/go-github/v45/github/code-scanning.go b/vendor/github.com/google/go-github/v46/github/code-scanning.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/code-scanning.go rename to vendor/github.com/google/go-github/v46/github/code-scanning.go diff --git a/vendor/github.com/google/go-github/v45/github/dependabot.go b/vendor/github.com/google/go-github/v46/github/dependabot.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/dependabot.go rename to vendor/github.com/google/go-github/v46/github/dependabot.go diff --git a/vendor/github.com/google/go-github/v45/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v46/github/dependabot_secrets.go similarity index 86% rename from vendor/github.com/google/go-github/v45/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v46/github/dependabot_secrets.go index f51f3396bd..8318cd812c 100644 --- a/vendor/github.com/google/go-github/v45/github/dependabot_secrets.go +++ b/vendor/github.com/google/go-github/v46/github/dependabot_secrets.go @@ -110,7 +110,20 @@ func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) return s.getSecret(ctx, url) } -func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { +// DependabotEncryptedSecret represents a secret that is encrypted using a public key for Dependabot. +// +// The value of EncryptedValue must be your secret, encrypted with +// LibSodium (see documentation here: https://libsodium.gitbook.io/doc/bindings_for_other_languages) +// using the public key retrieved using the GetPublicKey method. +type DependabotEncryptedSecret struct { + Name string `json:"-"` + KeyID string `json:"key_id"` + EncryptedValue string `json:"encrypted_value"` + Visibility string `json:"visibility,omitempty"` + SelectedRepositoryIDs DependabotSecretsSelectedRepoIDs `json:"selected_repository_ids,omitempty"` +} + +func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *DependabotEncryptedSecret) (*Response, error) { req, err := s.client.NewRequest("PUT", url, eSecret) if err != nil { return nil, err @@ -122,7 +135,7 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-a-repository-secret -func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { +func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -130,7 +143,7 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#create-or-update-an-organization-secret -func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { +func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -184,13 +197,16 @@ func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, o return result, resp, nil } +// DependabotSecretsSelectedRepoIDs are the repository IDs that have access to the dependabot secrets. +type DependabotSecretsSelectedRepoIDs []string + // SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. // // GitHub API docs: https://docs.github.com/en/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret -func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { +func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) { url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) type repoIDs struct { - SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` + SelectedIDs DependabotSecretsSelectedRepoIDs `json:"selected_repository_ids"` } req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) diff --git a/vendor/github.com/google/go-github/v45/github/doc.go b/vendor/github.com/google/go-github/v46/github/doc.go similarity index 97% rename from vendor/github.com/google/go-github/v45/github/doc.go rename to vendor/github.com/google/go-github/v46/github/doc.go index 38cda12b2b..e6f1a56398 100644 --- a/vendor/github.com/google/go-github/v45/github/doc.go +++ b/vendor/github.com/google/go-github/v46/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v45/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v46/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 @@ -38,7 +38,7 @@ can be used as a starting point. For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory. -Authentication +# Authentication The go-github library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for @@ -110,7 +110,7 @@ To authenticate as an app, using a JWT: // Use client... } -Rate Limiting +# Rate Limiting GitHub imposes a rate limit on all API clients. Unauthenticated clients are limited to 60 requests per hour, while authenticated clients can make up to @@ -139,7 +139,7 @@ For secondary rate limits, you can check if its type is *github.AbuseRateLimitEr Learn more about GitHub rate limiting at https://docs.github.com/en/rest/rate-limit . -Accepted Status +# Accepted Status Some endpoints may return a 202 Accepted status code, meaning that the information required is not yet ready and was scheduled to be gathered on @@ -154,7 +154,7 @@ To detect this condition of error, you can check if its type is log.Println("scheduled on GitHub side") } -Conditional Requests +# Conditional Requests The GitHub API has good support for conditional requests which will help prevent you from burning through your rate limit, as well as help speed up your @@ -165,7 +165,7 @@ https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at https://docs.github.com/en/rest/overview/resources-in-the-rest-api#conditional-requests. -Creating and Updating Resources +# Creating and Updating Resources All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. @@ -181,7 +181,7 @@ bool, and int values. For example: Users who have worked with protocol buffers should find this pattern familiar. -Pagination +# Pagination All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the @@ -208,6 +208,5 @@ github.Response struct. } opt.Page = resp.NextPage } - */ package github diff --git a/vendor/github.com/google/go-github/v45/github/enterprise.go b/vendor/github.com/google/go-github/v46/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/enterprise.go rename to vendor/github.com/google/go-github/v46/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v45/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v46/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v46/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v45/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v46/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v46/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v45/github/event.go b/vendor/github.com/google/go-github/v46/github/event.go similarity index 98% rename from vendor/github.com/google/go-github/v45/github/event.go rename to vendor/github.com/google/go-github/v46/github/event.go index 5a052de09c..4cacf0a83f 100644 --- a/vendor/github.com/google/go-github/v45/github/event.go +++ b/vendor/github.com/google/go-github/v46/github/event.go @@ -36,6 +36,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &CheckRunEvent{} case "CheckSuiteEvent": payload = &CheckSuiteEvent{} + case "CodeScanningAlertEvent": + payload = &CodeScanningAlertEvent{} case "CommitCommentEvent": payload = &CommitCommentEvent{} case "ContentReferenceEvent": diff --git a/vendor/github.com/google/go-github/v45/github/event_types.go b/vendor/github.com/google/go-github/v46/github/event_types.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/event_types.go rename to vendor/github.com/google/go-github/v46/github/event_types.go diff --git a/vendor/github.com/google/go-github/v45/github/gists.go b/vendor/github.com/google/go-github/v46/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/gists.go rename to vendor/github.com/google/go-github/v46/github/gists.go diff --git a/vendor/github.com/google/go-github/v45/github/gists_comments.go b/vendor/github.com/google/go-github/v46/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/gists_comments.go rename to vendor/github.com/google/go-github/v46/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v45/github/git.go b/vendor/github.com/google/go-github/v46/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/git.go rename to vendor/github.com/google/go-github/v46/github/git.go diff --git a/vendor/github.com/google/go-github/v45/github/git_blobs.go b/vendor/github.com/google/go-github/v46/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/git_blobs.go rename to vendor/github.com/google/go-github/v46/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v45/github/git_commits.go b/vendor/github.com/google/go-github/v46/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/git_commits.go rename to vendor/github.com/google/go-github/v46/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v45/github/git_refs.go b/vendor/github.com/google/go-github/v46/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/git_refs.go rename to vendor/github.com/google/go-github/v46/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v45/github/git_tags.go b/vendor/github.com/google/go-github/v46/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/git_tags.go rename to vendor/github.com/google/go-github/v46/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v45/github/git_trees.go b/vendor/github.com/google/go-github/v46/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/git_trees.go rename to vendor/github.com/google/go-github/v46/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v45/github/github-accessors.go b/vendor/github.com/google/go-github/v46/github/github-accessors.go similarity index 99% rename from vendor/github.com/google/go-github/v45/github/github-accessors.go rename to vendor/github.com/google/go-github/v46/github/github-accessors.go index 0092c58840..013780bff9 100644 --- a/vendor/github.com/google/go-github/v45/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v46/github/github-accessors.go @@ -1030,6 +1030,14 @@ func (a *AuditEntry) GetRepositoryPublic() bool { return *a.RepositoryPublic } +// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise. +func (a *AuditEntry) GetRunAttempt() int64 { + if a == nil || a.RunAttempt == nil { + return 0 + } + return *a.RunAttempt +} + // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetRunnerGroupID() int64 { if a == nil || a.RunnerGroupID == nil { @@ -2286,6 +2294,14 @@ func (c *CodeOfConduct) GetURL() string { return *c.URL } +// GetSuggestion returns the Suggestion field if it's non-nil, zero value otherwise. +func (c *CodeownersError) GetSuggestion() string { + if c == nil || c.Suggestion == nil { + return "" + } + return *c.Suggestion +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (c *CodeResult) GetHTMLURL() string { if c == nil || c.HTMLURL == nil { @@ -7630,6 +7646,14 @@ func (i *IssueRequest) GetState() string { return *i.State } +// GetStateReason returns the StateReason field if it's non-nil, zero value otherwise. +func (i *IssueRequest) GetStateReason() string { + if i == nil || i.StateReason == nil { + return "" + } + return *i.StateReason +} + // GetTitle returns the Title field if it's non-nil, zero value otherwise. func (i *IssueRequest) GetTitle() string { if i == nil || i.Title == nil { @@ -10782,12 +10806,12 @@ func (p *PagesUpdate) GetPublic() bool { return *p.Public } -// GetSource returns the Source field if it's non-nil, zero value otherwise. -func (p *PagesUpdate) GetSource() string { - if p == nil || p.Source == nil { - return "" +// GetSource returns the Source field. +func (p *PagesUpdate) GetSource() *PagesSource { + if p == nil { + return nil } - return *p.Source + return p.Source } // GetHook returns the Hook field. @@ -12886,6 +12910,14 @@ func (p *PullRequestReviewRequest) GetNodeID() string { return *p.NodeID } +// GetBypassPullRequestAllowances returns the BypassPullRequestAllowances field. +func (p *PullRequestReviewsEnforcement) GetBypassPullRequestAllowances() *BypassPullRequestAllowances { + if p == nil { + return nil + } + return p.BypassPullRequestAllowances +} + // GetDismissalRestrictions returns the DismissalRestrictions field. func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRestrictions { if p == nil { @@ -12894,6 +12926,14 @@ func (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRes return p.DismissalRestrictions } +// GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field. +func (p *PullRequestReviewsEnforcementRequest) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest { + if p == nil { + return nil + } + return p.BypassPullRequestAllowancesRequest +} + // GetDismissalRestrictionsRequest returns the DismissalRestrictionsRequest field. func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() *DismissalRestrictionsRequest { if p == nil { @@ -12902,6 +12942,14 @@ func (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() return p.DismissalRestrictionsRequest } +// GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field. +func (p *PullRequestReviewsEnforcementUpdate) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest { + if p == nil { + return nil + } + return p.BypassPullRequestAllowancesRequest +} + // GetDismissalRestrictionsRequest returns the DismissalRestrictionsRequest field. func (p *PullRequestReviewsEnforcementUpdate) GetDismissalRestrictionsRequest() *DismissalRestrictionsRequest { if p == nil { @@ -17278,6 +17326,22 @@ func (t *Tag) GetVerification() *SignatureVerification { return t.Verification } +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (t *TagProtection) GetID() int64 { + if t == nil || t.ID == nil { + return 0 + } + return *t.ID +} + +// GetPattern returns the Pattern field if it's non-nil, zero value otherwise. +func (t *TagProtection) GetPattern() string { + if t == nil || t.Pattern == nil { + return "" + } + return *t.Pattern +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (t *TaskStep) GetCompletedAt() Timestamp { if t == nil || t.CompletedAt == nil { diff --git a/vendor/github.com/google/go-github/v45/github/github.go b/vendor/github.com/google/go-github/v46/github/github.go similarity index 98% rename from vendor/github.com/google/go-github/v45/github/github.go rename to vendor/github.com/google/go-github/v46/github/github.go index 08b7db8e55..985a8a4374 100644 --- a/vendor/github.com/google/go-github/v45/github/github.go +++ b/vendor/github.com/google/go-github/v46/github/github.go @@ -28,9 +28,11 @@ import ( ) const ( - defaultBaseURL = "https://api.github.com/" - uploadBaseURL = "https://uploads.github.com/" - userAgent = "go-github" + Version = "46.0.0" + + defaultBaseURL = "https://api.github.com/" + defaultUserAgent = "go-github" + "/" + Version + uploadBaseURL = "https://uploads.github.com/" headerRateLimit = "X-RateLimit-Limit" headerRateRemaining = "X-RateLimit-Remaining" @@ -301,7 +303,7 @@ func NewClient(httpClient *http.Client) *Client { baseURL, _ := url.Parse(defaultBaseURL) uploadURL, _ := url.Parse(uploadBaseURL) - c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: userAgent, UploadURL: uploadURL} + c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: defaultUserAgent, UploadURL: uploadURL} c.common.client = c c.Actions = (*ActionsService)(&c.common) c.Activity = (*ActivityService)(&c.common) @@ -947,17 +949,17 @@ func sanitizeURL(uri *url.URL) *url.URL { An Error reports more details on an individual error in an ErrorResponse. These are the possible validation error codes: - missing: - resource does not exist - missing_field: - a required field on a resource has not been set - invalid: - the formatting of a field is invalid - already_exists: - another resource has the same valid as this field - custom: - some resources return this (e.g. github.User.CreateKey()), additional - information is set in the Message field of the Error + missing: + resource does not exist + missing_field: + a required field on a resource has not been set + invalid: + the formatting of a field is invalid + already_exists: + another resource has the same valid as this field + custom: + some resources return this (e.g. github.User.CreateKey()), additional + information is set in the Message field of the Error GitHub error responses structure are often undocumented and inconsistent. Sometimes error is just a simple string (Issue #540). diff --git a/vendor/github.com/google/go-github/v45/github/gitignore.go b/vendor/github.com/google/go-github/v46/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/gitignore.go rename to vendor/github.com/google/go-github/v46/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v45/github/interactions.go b/vendor/github.com/google/go-github/v46/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/interactions.go rename to vendor/github.com/google/go-github/v46/github/interactions.go diff --git a/vendor/github.com/google/go-github/v45/github/interactions_orgs.go b/vendor/github.com/google/go-github/v46/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v46/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v45/github/interactions_repos.go b/vendor/github.com/google/go-github/v46/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/interactions_repos.go rename to vendor/github.com/google/go-github/v46/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v45/github/issue_import.go b/vendor/github.com/google/go-github/v46/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issue_import.go rename to vendor/github.com/google/go-github/v46/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v45/github/issues.go b/vendor/github.com/google/go-github/v46/github/issues.go similarity index 96% rename from vendor/github.com/google/go-github/v45/github/issues.go rename to vendor/github.com/google/go-github/v46/github/issues.go index 12488f9815..351ec09cc4 100644 --- a/vendor/github.com/google/go-github/v45/github/issues.go +++ b/vendor/github.com/google/go-github/v46/github/issues.go @@ -77,13 +77,15 @@ func (i Issue) IsPullRequest() bool { // It is separate from Issue above because otherwise Labels // and Assignee fail to serialize to the correct JSON. type IssueRequest struct { - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Assignee *string `json:"assignee,omitempty"` - State *string `json:"state,omitempty"` - Milestone *int `json:"milestone,omitempty"` - Assignees *[]string `json:"assignees,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + Labels *[]string `json:"labels,omitempty"` + Assignee *string `json:"assignee,omitempty"` + State *string `json:"state,omitempty"` + // StateReason can be 'completed' or 'not_planned'. + StateReason *string `json:"state_reason,omitempty"` + Milestone *int `json:"milestone,omitempty"` + Assignees *[]string `json:"assignees,omitempty"` } // IssueListOptions specifies the optional parameters to the IssuesService.List diff --git a/vendor/github.com/google/go-github/v45/github/issues_assignees.go b/vendor/github.com/google/go-github/v46/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issues_assignees.go rename to vendor/github.com/google/go-github/v46/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v45/github/issues_comments.go b/vendor/github.com/google/go-github/v46/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issues_comments.go rename to vendor/github.com/google/go-github/v46/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v45/github/issues_events.go b/vendor/github.com/google/go-github/v46/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issues_events.go rename to vendor/github.com/google/go-github/v46/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v45/github/issues_labels.go b/vendor/github.com/google/go-github/v46/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issues_labels.go rename to vendor/github.com/google/go-github/v46/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v45/github/issues_milestones.go b/vendor/github.com/google/go-github/v46/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issues_milestones.go rename to vendor/github.com/google/go-github/v46/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v45/github/issues_timeline.go b/vendor/github.com/google/go-github/v46/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/issues_timeline.go rename to vendor/github.com/google/go-github/v46/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v45/github/licenses.go b/vendor/github.com/google/go-github/v46/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/licenses.go rename to vendor/github.com/google/go-github/v46/github/licenses.go diff --git a/vendor/github.com/google/go-github/v45/github/messages.go b/vendor/github.com/google/go-github/v46/github/messages.go similarity index 90% rename from vendor/github.com/google/go-github/v45/github/messages.go rename to vendor/github.com/google/go-github/v46/github/messages.go index 44477ddb0d..320bd73422 100644 --- a/vendor/github.com/google/go-github/v45/github/messages.go +++ b/vendor/github.com/google/go-github/v46/github/messages.go @@ -48,6 +48,7 @@ var ( "branch_protection_rule": "BranchProtectionRuleEvent", "check_run": "CheckRunEvent", "check_suite": "CheckSuiteEvent", + "code_scanning_alert": "CodeScanningAlertEvent", "commit_comment": "CommitCommentEvent", "content_reference": "ContentReferenceEvent", "create": "CreateEvent", @@ -156,13 +157,13 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { // // Example usage: // -// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// // read signature from request -// signature := "" -// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... -// } +// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { +// // read signature from request +// signature := "" +// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... +// } func ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error) { var body []byte // Raw body that GitHub uses to calculate the signature. @@ -220,12 +221,11 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s // // Example usage: // -// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... -// } -// +// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... +// } func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { signature := r.Header.Get(SHA256SignatureHeader) if signature == "" { @@ -278,20 +278,19 @@ func DeliveryID(r *http.Request) string { // // Example usage: // -// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// event, err := github.ParseWebHook(github.WebHookType(r), payload) -// if err != nil { ... } -// switch event := event.(type) { -// case *github.CommitCommentEvent: -// processCommitCommentEvent(event) -// case *github.CreateEvent: -// processCreateEvent(event) -// ... -// } -// } -// +// func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// event, err := github.ParseWebHook(github.WebHookType(r), payload) +// if err != nil { ... } +// switch event := event.(type) { +// case *github.CommitCommentEvent: +// processCommitCommentEvent(event) +// case *github.CreateEvent: +// processCreateEvent(event) +// ... +// } +// } func ParseWebHook(messageType string, payload []byte) (interface{}, error) { eventType, ok := eventTypeMapping[messageType] if !ok { diff --git a/vendor/github.com/google/go-github/v45/github/migrations.go b/vendor/github.com/google/go-github/v46/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/migrations.go rename to vendor/github.com/google/go-github/v46/github/migrations.go diff --git a/vendor/github.com/google/go-github/v45/github/migrations_source_import.go b/vendor/github.com/google/go-github/v46/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v46/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v45/github/migrations_user.go b/vendor/github.com/google/go-github/v46/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/migrations_user.go rename to vendor/github.com/google/go-github/v46/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v45/github/misc.go b/vendor/github.com/google/go-github/v46/github/misc.go similarity index 96% rename from vendor/github.com/google/go-github/v45/github/misc.go rename to vendor/github.com/google/go-github/v46/github/misc.go index 412d1e2b95..8961524157 100644 --- a/vendor/github.com/google/go-github/v45/github/misc.go +++ b/vendor/github.com/google/go-github/v46/github/misc.go @@ -176,6 +176,14 @@ type APIMeta struct { // An array of SSH keys. SSHKeys []string `json:"ssh_keys,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub websites. + Web []string `json:"web,omitempty"` + + // An array of IP addresses in CIDR format specifying the addresses + // which serve GitHub APIs. + API []string `json:"api,omitempty"` } // APIMeta returns information about GitHub.com, the service. Or, if you access diff --git a/vendor/github.com/google/go-github/v45/github/orgs.go b/vendor/github.com/google/go-github/v46/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs.go rename to vendor/github.com/google/go-github/v46/github/orgs.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v46/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v46/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v46/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v46/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v46/github/orgs_audit_log.go similarity index 98% rename from vendor/github.com/google/go-github/v45/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v46/github/orgs_audit_log.go index 52bacfed9a..be5fd24d6e 100644 --- a/vendor/github.com/google/go-github/v45/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v46/github/orgs_audit_log.go @@ -70,6 +70,7 @@ type AuditEntry struct { Repo *string `json:"repo,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryPublic *bool `json:"repository_public,omitempty"` + RunAttempt *int64 `json:"run_attempt,omitempty"` RunnerGroupID *int64 `json:"runner_group_id,omitempty"` RunnerGroupName *string `json:"runner_group_name,omitempty"` RunnerID *int64 `json:"runner_id,omitempty"` diff --git a/vendor/github.com/google/go-github/v45/github/orgs_custom_roles.go b/vendor/github.com/google/go-github/v46/github/orgs_custom_roles.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_custom_roles.go rename to vendor/github.com/google/go-github/v46/github/orgs_custom_roles.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_hooks.go b/vendor/github.com/google/go-github/v46/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v46/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v46/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v46/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_members.go b/vendor/github.com/google/go-github/v46/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_members.go rename to vendor/github.com/google/go-github/v46/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v46/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v46/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_packages.go b/vendor/github.com/google/go-github/v46/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_packages.go rename to vendor/github.com/google/go-github/v46/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_projects.go b/vendor/github.com/google/go-github/v46/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_projects.go rename to vendor/github.com/google/go-github/v46/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v45/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v46/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v46/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v45/github/packages.go b/vendor/github.com/google/go-github/v46/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/packages.go rename to vendor/github.com/google/go-github/v46/github/packages.go diff --git a/vendor/github.com/google/go-github/v45/github/projects.go b/vendor/github.com/google/go-github/v46/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/projects.go rename to vendor/github.com/google/go-github/v46/github/projects.go diff --git a/vendor/github.com/google/go-github/v45/github/pulls.go b/vendor/github.com/google/go-github/v46/github/pulls.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/pulls.go rename to vendor/github.com/google/go-github/v46/github/pulls.go diff --git a/vendor/github.com/google/go-github/v45/github/pulls_comments.go b/vendor/github.com/google/go-github/v46/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/pulls_comments.go rename to vendor/github.com/google/go-github/v46/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v45/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v46/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v46/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v45/github/pulls_reviews.go b/vendor/github.com/google/go-github/v46/github/pulls_reviews.go similarity index 95% rename from vendor/github.com/google/go-github/v45/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v46/github/pulls_reviews.go index 14e20322ae..77bf60ce2d 100644 --- a/vendor/github.com/google/go-github/v45/github/pulls_reviews.go +++ b/vendor/github.com/google/go-github/v46/github/pulls_reviews.go @@ -193,35 +193,37 @@ func (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, rep // // In order to use multi-line comments, you must use the "comfort fade" preview. // This replaces the use of the "Position" field in comments with 4 new fields: -// [Start]Side, and [Start]Line. +// +// [Start]Side, and [Start]Line. +// // These new fields must be used for ALL comments (including single-line), // with the following restrictions (empirically observed, so subject to change). // // For single-line "comfort fade" comments, you must use: // -// Path: &path, // as before -// Body: &body, // as before -// Side: &"RIGHT" (or "LEFT") -// Line: &123, // NOT THE SAME AS POSITION, this is an actual line number. +// Path: &path, // as before +// Body: &body, // as before +// Side: &"RIGHT" (or "LEFT") +// Line: &123, // NOT THE SAME AS POSITION, this is an actual line number. // // If StartSide or StartLine is used with single-line comments, a 422 is returned. // // For multi-line "comfort fade" comments, you must use: // -// Path: &path, // as before -// Body: &body, // as before -// StartSide: &"RIGHT" (or "LEFT") -// Side: &"RIGHT" (or "LEFT") -// StartLine: &120, -// Line: &125, +// Path: &path, // as before +// Body: &body, // as before +// StartSide: &"RIGHT" (or "LEFT") +// Side: &"RIGHT" (or "LEFT") +// StartLine: &120, +// Line: &125, // // Suggested edits are made by commenting on the lines to replace, and including the // suggested edit in a block like this (it may be surrounded in non-suggestion markdown): // -// ```suggestion -// Use this instead. -// It is waaaaaay better. -// ``` +// ```suggestion +// Use this instead. +// It is waaaaaay better. +// ``` func (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/reviews", owner, repo, number) diff --git a/vendor/github.com/google/go-github/v45/github/pulls_threads.go b/vendor/github.com/google/go-github/v46/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/pulls_threads.go rename to vendor/github.com/google/go-github/v46/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v45/github/reactions.go b/vendor/github.com/google/go-github/v46/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/reactions.go rename to vendor/github.com/google/go-github/v46/github/reactions.go diff --git a/vendor/github.com/google/go-github/v45/github/repos.go b/vendor/github.com/google/go-github/v46/github/repos.go similarity index 97% rename from vendor/github.com/google/go-github/v45/github/repos.go rename to vendor/github.com/google/go-github/v46/github/repos.go index a5f7fc6cf8..6ad88b3e2b 100644 --- a/vendor/github.com/google/go-github/v45/github/repos.go +++ b/vendor/github.com/google/go-github/v46/github/repos.go @@ -725,10 +725,10 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // specifies the languages and the number of bytes of code written in that // language. For example: // -// { -// "C": 78769, -// "Python": 7769 -// } +// { +// "C": 78769, +// "Python": 7769 +// } // // GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-repository-languages func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { @@ -919,6 +919,8 @@ type RequiredStatusCheck struct { // PullRequestReviewsEnforcement represents the pull request reviews enforcement of a protected branch. type PullRequestReviewsEnforcement struct { + // Allow specific users, teams, or apps to bypass pull request requirements. + BypassPullRequestAllowances *BypassPullRequestAllowances `json:"bypass_pull_request_allowances,omitempty"` // Specifies which users and teams can dismiss pull request reviews. DismissalRestrictions *DismissalRestrictions `json:"dismissal_restrictions,omitempty"` // Specifies if approved reviews are dismissed automatically, when a new commit is pushed. @@ -934,6 +936,8 @@ type PullRequestReviewsEnforcement struct { // enforcement of a protected branch. It is separate from PullRequestReviewsEnforcement above // because the request structure is different from the response structure. type PullRequestReviewsEnforcementRequest struct { + // Allow specific users, teams, or apps to bypass pull request requirements. + BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"` // Specifies which users and teams should be allowed to dismiss pull request reviews. // User and team dismissal restrictions are only available for // organization-owned repositories. Must be nil for personal repositories. @@ -951,6 +955,8 @@ type PullRequestReviewsEnforcementRequest struct { // enforcement of a protected branch. It is separate from PullRequestReviewsEnforcementRequest above // because the patch request does not require all fields to be initialized. type PullRequestReviewsEnforcementUpdate struct { + // Allow specific users, teams, or apps to bypass pull request requirements. + BypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:"bypass_pull_request_allowances,omitempty"` // Specifies which users and teams can dismiss pull request reviews. Can be omitted. DismissalRestrictionsRequest *DismissalRestrictionsRequest `json:"dismissal_restrictions,omitempty"` // Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. Can be omitted. @@ -1012,6 +1018,29 @@ type BranchRestrictionsRequest struct { Apps []string `json:"apps,omitempty"` } +// BypassPullRequestAllowances represents the people, teams, or apps who are allowed to bypass required pull requests. +type BypassPullRequestAllowances struct { + // The list of users allowed to bypass pull request requirements. + Users []*User `json:"users"` + // The list of teams allowed to bypass pull request requirements. + Teams []*Team `json:"teams"` + // The list of apps allowed to bypass pull request requirements. + Apps []*App `json:"apps"` +} + +// BypassPullRequestAllowancesRequest represents the people, teams, or apps who are +// allowed to bypass required pull requests. +// It is separate from BypassPullRequestAllowances above because the request structure is +// different from the response structure. +type BypassPullRequestAllowancesRequest struct { + // The list of user logins allowed to bypass pull request requirements. + Users []string `json:"users"` + // The list of team slugs allowed to bypass pull request requirements. + Teams []string `json:"teams"` + // The list of app slugs allowed to bypass pull request requirements. + Apps []string `json:"apps"` +} + // DismissalRestrictions specifies which users and teams can dismiss pull request reviews. type DismissalRestrictions struct { // The list of users who can dimiss pull request reviews. diff --git a/vendor/github.com/google/go-github/v45/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v46/github/repos_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v46/github/repos_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v46/github/repos_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v46/github/repos_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_autolinks.go b/vendor/github.com/google/go-github/v46/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v46/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v46/github/repos_codeowners.go b/vendor/github.com/google/go-github/v46/github/repos_codeowners.go new file mode 100644 index 0000000000..835d56e164 --- /dev/null +++ b/vendor/github.com/google/go-github/v46/github/repos_codeowners.go @@ -0,0 +1,46 @@ +// Copyright 2022 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// CodeownersErrors represents a list of syntax errors detected in the CODEOWNERS file. +type CodeownersErrors struct { + Errors []*CodeownersError `json:"errors"` +} + +// CodeownersError represents a syntax error detected in the CODEOWNERS file. +type CodeownersError struct { + Line int `json:"line"` + Column int `json:"column"` + Kind string `json:"kind"` + Source string `json:"source"` + Suggestion *string `json:"suggestion,omitempty"` + Message string `json:"message"` + Path string `json:"path"` +} + +// GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/repos#list-codeowners-errors +func (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string) (*CodeownersErrors, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/codeowners/errors", owner, repo) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + codeownersErrors := &CodeownersErrors{} + resp, err := s.client.Do(ctx, req, codeownersErrors) + if err != nil { + return nil, resp, err + } + + return codeownersErrors, resp, nil +} diff --git a/vendor/github.com/google/go-github/v45/github/repos_collaborators.go b/vendor/github.com/google/go-github/v46/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v46/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_comments.go b/vendor/github.com/google/go-github/v46/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_comments.go rename to vendor/github.com/google/go-github/v46/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_commits.go b/vendor/github.com/google/go-github/v46/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_commits.go rename to vendor/github.com/google/go-github/v46/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_community_health.go b/vendor/github.com/google/go-github/v46/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_community_health.go rename to vendor/github.com/google/go-github/v46/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_contents.go b/vendor/github.com/google/go-github/v46/github/repos_contents.go similarity index 99% rename from vendor/github.com/google/go-github/v45/github/repos_contents.go rename to vendor/github.com/google/go-github/v46/github/repos_contents.go index d6f2dd9d74..431d4b12dc 100644 --- a/vendor/github.com/google/go-github/v45/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v46/github/repos_contents.go @@ -51,7 +51,7 @@ type RepositoryContentResponse struct { // RepositoryContentFileOptions specifies optional parameters for CreateFile, UpdateFile, and DeleteFile. type RepositoryContentFileOptions struct { Message *string `json:"message,omitempty"` - Content []byte `json:"content,omitempty"` // unencoded + Content []byte `json:"content"` // unencoded SHA *string `json:"sha,omitempty"` Branch *string `json:"branch,omitempty"` Author *CommitAuthor `json:"author,omitempty"` diff --git a/vendor/github.com/google/go-github/v45/github/repos_deployments.go b/vendor/github.com/google/go-github/v46/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_deployments.go rename to vendor/github.com/google/go-github/v46/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_environments.go b/vendor/github.com/google/go-github/v46/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_environments.go rename to vendor/github.com/google/go-github/v46/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_forks.go b/vendor/github.com/google/go-github/v46/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_forks.go rename to vendor/github.com/google/go-github/v46/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_hooks.go b/vendor/github.com/google/go-github/v46/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_hooks.go rename to vendor/github.com/google/go-github/v46/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v46/github/repos_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v46/github/repos_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_invitations.go b/vendor/github.com/google/go-github/v46/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_invitations.go rename to vendor/github.com/google/go-github/v46/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_keys.go b/vendor/github.com/google/go-github/v46/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_keys.go rename to vendor/github.com/google/go-github/v46/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v46/github/repos_lfs.go b/vendor/github.com/google/go-github/v46/github/repos_lfs.go new file mode 100644 index 0000000000..6ac2e5a877 --- /dev/null +++ b/vendor/github.com/google/go-github/v46/github/repos_lfs.go @@ -0,0 +1,49 @@ +// Copyright 2022 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#enable-git-lfs-for-a-repository +func (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) + + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/lfs#disable-git-lfs-for-a-repository +func (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/lfs", owner, repo) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/vendor/github.com/google/go-github/v45/github/repos_merging.go b/vendor/github.com/google/go-github/v46/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_merging.go rename to vendor/github.com/google/go-github/v46/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_pages.go b/vendor/github.com/google/go-github/v46/github/repos_pages.go similarity index 97% rename from vendor/github.com/google/go-github/v45/github/repos_pages.go rename to vendor/github.com/google/go-github/v46/github/repos_pages.go index 9b864eb090..737cec0f22 100644 --- a/vendor/github.com/google/go-github/v45/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v46/github/repos_pages.go @@ -93,8 +93,10 @@ type PagesUpdate struct { // Leaving CNAME empty will remove the custom domain. CNAME *string `json:"cname"` // Source must include the branch name, and may optionally specify the subdirectory "/docs". - // Possible values are: "gh-pages", "master", and "master /docs". - Source *string `json:"source,omitempty"` + // Possible values for Source.Branch are usually "gh-pages", "main", and "master", + // or any other existing branch name. + // Possible values for Source.Path are: "/", and "/docs". + Source *PagesSource `json:"source,omitempty"` // Public configures access controls for the site. // If "true", the site will be accessible to anyone on the internet. If "false", // the site will be accessible to anyone with read access to the repository that diff --git a/vendor/github.com/google/go-github/v45/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v46/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v46/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_projects.go b/vendor/github.com/google/go-github/v46/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_projects.go rename to vendor/github.com/google/go-github/v46/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_releases.go b/vendor/github.com/google/go-github/v46/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_releases.go rename to vendor/github.com/google/go-github/v46/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_stats.go b/vendor/github.com/google/go-github/v46/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_stats.go rename to vendor/github.com/google/go-github/v46/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v45/github/repos_statuses.go b/vendor/github.com/google/go-github/v46/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_statuses.go rename to vendor/github.com/google/go-github/v46/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v46/github/repos_tags.go b/vendor/github.com/google/go-github/v46/github/repos_tags.go new file mode 100644 index 0000000000..ff46d90c73 --- /dev/null +++ b/vendor/github.com/google/go-github/v46/github/repos_tags.go @@ -0,0 +1,76 @@ +// Copyright 2022 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// TagProtection represents a repository tag protection. +type TagProtection struct { + ID *int64 `json:"id"` + Pattern *string `json:"pattern"` +} + +// tagProtectionRequest represents a request to create tag protection. +type tagProtectionRequest struct { + // An optional glob pattern to match against when enforcing tag protection. + Pattern string `json:"pattern"` +} + +// ListTagProtection lists tag protection of the specified repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/tags#list-tag-protection-states-for-a-repository +func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var tagProtections []*TagProtection + resp, err := s.client.Do(ctx, req, &tagProtections) + if err != nil { + return nil, resp, err + } + + return tagProtections, resp, nil +} + +// CreateTagProtection creates the tag protection of the specified repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/tags#create-a-tag-protection-state-for-a-repository +func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/tags/protection", owner, repo) + r := &tagProtectionRequest{Pattern: pattern} + req, err := s.client.NewRequest("POST", u, r) + if err != nil { + return nil, nil, err + } + + tagProtection := new(TagProtection) + resp, err := s.client.Do(ctx, req, tagProtection) + if err != nil { + return nil, resp, err + } + + return tagProtection, resp, nil +} + +// DeleteTagProtection deletes a tag protection from the specified repository. +// +// GitHub API docs: https://docs.github.com/en/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/tags/protection/%v", owner, repo, tagProtectionID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v45/github/repos_traffic.go b/vendor/github.com/google/go-github/v46/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/repos_traffic.go rename to vendor/github.com/google/go-github/v46/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v45/github/scim.go b/vendor/github.com/google/go-github/v46/github/scim.go similarity index 99% rename from vendor/github.com/google/go-github/v45/github/scim.go rename to vendor/github.com/google/go-github/v46/github/scim.go index c4abb9ab3e..9462fb6ba6 100644 --- a/vendor/github.com/google/go-github/v45/github/scim.go +++ b/vendor/github.com/google/go-github/v46/github/scim.go @@ -38,7 +38,7 @@ type SCIMUserName struct { Formatted *string `json:"formatted,omitempty"` // (Optional.) } -//SCIMUserEmail represents SCIM user email. +// SCIMUserEmail represents SCIM user email. type SCIMUserEmail struct { Value string `json:"value"` // (Required.) Primary *bool `json:"primary,omitempty"` // (Optional.) diff --git a/vendor/github.com/google/go-github/v45/github/search.go b/vendor/github.com/google/go-github/v46/github/search.go similarity index 93% rename from vendor/github.com/google/go-github/v45/github/search.go rename to vendor/github.com/google/go-github/v46/github/search.go index 344f1bb985..adb832d0d8 100644 --- a/vendor/github.com/google/go-github/v45/github/search.go +++ b/vendor/github.com/google/go-github/v46/github/search.go @@ -9,6 +9,7 @@ import ( "context" "fmt" "strconv" + "strings" qs "github.com/google/go-querystring/query" ) @@ -19,8 +20,10 @@ import ( // Each method takes a query string defining the search keywords and any search qualifiers. // For example, when searching issues, the query "gopher is:issue language:go" will search // for issues containing the word "gopher" in Go repositories. The method call -// opts := &github.SearchOptions{Sort: "created", Order: "asc"} -// cl.Search.Issues(ctx, "gopher is:issue language:go", opts) +// +// opts := &github.SearchOptions{Sort: "created", Order: "asc"} +// cl.Search.Issues(ctx, "gopher is:issue language:go", opts) +// // will search for such issues, sorting by creation date in ascending order // (i.e., oldest first). // @@ -299,29 +302,32 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter if err != nil { return nil, err } - + var acceptHeaders []string switch { case searchType == "commits": // Accept header for search commits preview endpoint // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeCommitSearchPreview) + acceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview) case searchType == "topics": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeTopicsPreview) + acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) case searchType == "repositories": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeTopicsPreview) + acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) case searchType == "issues": // Accept header for search issues based on reactions preview endpoint // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeReactionsPreview) - case opts != nil && opts.TextMatch: - // Accept header defaults to "application/vnd.github.v3+json" - // We change it here to fetch back text-match metadata - req.Header.Set("Accept", "application/vnd.github.v3.text-match+json") + acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) + } + // https://docs.github.com/en/rest/search#search-repositories + // Accept header defaults to "application/vnd.github.v3+json" + // We change it here to fetch back text-match metadata + if opts != nil && opts.TextMatch { + acceptHeaders = append(acceptHeaders, "application/vnd.github.v3.text-match+json") } + req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) return s.client.Do(ctx, req, result) } diff --git a/vendor/github.com/google/go-github/v45/github/secret_scanning.go b/vendor/github.com/google/go-github/v46/github/secret_scanning.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/secret_scanning.go rename to vendor/github.com/google/go-github/v46/github/secret_scanning.go diff --git a/vendor/github.com/google/go-github/v45/github/strings.go b/vendor/github.com/google/go-github/v46/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/strings.go rename to vendor/github.com/google/go-github/v46/github/strings.go diff --git a/vendor/github.com/google/go-github/v45/github/teams.go b/vendor/github.com/google/go-github/v46/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/teams.go rename to vendor/github.com/google/go-github/v46/github/teams.go diff --git a/vendor/github.com/google/go-github/v45/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v46/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v46/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v45/github/teams_discussions.go b/vendor/github.com/google/go-github/v46/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/teams_discussions.go rename to vendor/github.com/google/go-github/v46/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v45/github/teams_members.go b/vendor/github.com/google/go-github/v46/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/teams_members.go rename to vendor/github.com/google/go-github/v46/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v45/github/timestamp.go b/vendor/github.com/google/go-github/v46/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/timestamp.go rename to vendor/github.com/google/go-github/v46/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v45/github/users.go b/vendor/github.com/google/go-github/v46/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users.go rename to vendor/github.com/google/go-github/v46/github/users.go diff --git a/vendor/github.com/google/go-github/v45/github/users_administration.go b/vendor/github.com/google/go-github/v46/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_administration.go rename to vendor/github.com/google/go-github/v46/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v45/github/users_blocking.go b/vendor/github.com/google/go-github/v46/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_blocking.go rename to vendor/github.com/google/go-github/v46/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v45/github/users_emails.go b/vendor/github.com/google/go-github/v46/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_emails.go rename to vendor/github.com/google/go-github/v46/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v45/github/users_followers.go b/vendor/github.com/google/go-github/v46/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_followers.go rename to vendor/github.com/google/go-github/v46/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v45/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v46/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v46/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v45/github/users_keys.go b/vendor/github.com/google/go-github/v46/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_keys.go rename to vendor/github.com/google/go-github/v46/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v45/github/users_packages.go b/vendor/github.com/google/go-github/v46/github/users_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_packages.go rename to vendor/github.com/google/go-github/v46/github/users_packages.go diff --git a/vendor/github.com/google/go-github/v45/github/users_projects.go b/vendor/github.com/google/go-github/v46/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/users_projects.go rename to vendor/github.com/google/go-github/v46/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v45/github/with_appengine.go b/vendor/github.com/google/go-github/v46/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/with_appengine.go rename to vendor/github.com/google/go-github/v46/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v45/github/without_appengine.go b/vendor/github.com/google/go-github/v46/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v45/github/without_appengine.go rename to vendor/github.com/google/go-github/v46/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index e3f2754e53..d3d1bd6069 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -180,9 +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/v45 v45.2.0 +# github.com/google/go-github/v46 v46.0.0 ## explicit -github.com/google/go-github/v45/github +github.com/google/go-github/v46/github # github.com/google/go-querystring v1.1.0 github.com/google/go-querystring/query # github.com/google/uuid v1.1.1