From 1891e8bc8448c334b42f2d7046829e88e8506467 Mon Sep 17 00:00:00 2001 From: Xun Guo Date: Thu, 12 Aug 2021 12:12:31 +1000 Subject: [PATCH] Update go-github version to v38.1.0 go-github released the Go client library to [38.1.0][1] recently. API changes includes: * Add ListOptions required by GetCommit method. As described in change[2] * Add followRedirects required by GetBranch method and set it to false as start point. As described in change[3] [1]: https://github.com/google/go-github/releases/tag/v38.1.0 [2]: https://github.com/google/go-github/pull/1960 [3]: https://github.com/google/go-github/pull/1901 --- github/config.go | 12 +- github/data_source_github_branch.go | 2 +- github/data_source_github_collaborators.go | 2 +- github/data_source_github_organization.go | 2 +- ...ce_github_organization_team_sync_groups.go | 2 +- github/data_source_github_release.go | 2 +- github/data_source_github_repositories.go | 2 +- ..._source_github_repository_pull_requests.go | 2 +- github/data_source_github_team.go | 2 +- ...ource_github_actions_environment_secret.go | 2 +- ...urce_github_actions_organization_secret.go | 2 +- github/resource_github_actions_secret.go | 2 +- ...urce_github_app_installation_repository.go | 2 +- github/resource_github_branch.go | 2 +- github/resource_github_branch_default.go | 2 +- .../resource_github_branch_protection_v3.go | 2 +- ...ource_github_branch_protection_v3_utils.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_webhook.go | 2 +- github/resource_github_project_card.go | 2 +- github/resource_github_project_column.go | 2 +- github/resource_github_project_column_test.go | 2 +- github/resource_github_repository.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- .../resource_github_repository_environment.go | 2 +- github/resource_github_repository_file.go | 15 +- .../resource_github_repository_milestone.go | 2 +- github/resource_github_repository_project.go | 2 +- ...resource_github_repository_pull_request.go | 2 +- github/resource_github_repository_webhook.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_membership.go | 2 +- .../resource_github_team_membership_test.go | 2 +- github/resource_github_team_repository.go | 21 +- ...resource_github_team_sync_group_mapping.go | 2 +- ...rce_github_team_sync_group_mapping_test.go | 10 +- github/resource_github_user_gpg_key.go | 2 +- github/resource_github_user_ssh_key.go | 2 +- github/resource_organization_block.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util_permissions.go | 2 +- go.mod | 2 +- go.sum | 6 +- .../google/go-github/{v37 => v38}/AUTHORS | 21 + .../google/go-github/{v37 => v38}/LICENSE | 0 .../go-github/{v37 => v38}/github/actions.go | 0 .../{v37 => v38}/github/actions_artifacts.go | 0 .../github/actions_runner_groups.go | 7 +- .../{v37 => v38}/github/actions_runners.go | 59 +++ .../{v37 => v38}/github/actions_secrets.go | 2 +- .../github/actions_workflow_jobs.go | 0 .../github/actions_workflow_runs.go | 0 .../{v37 => v38}/github/actions_workflows.go | 0 .../go-github/{v37 => v38}/github/activity.go | 0 .../{v37 => v38}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{v37 => v38}/github/activity_star.go | 0 .../{v37 => v38}/github/activity_watching.go | 0 .../go-github/{v37 => v38}/github/admin.go | 0 .../{v37 => v38}/github/admin_orgs.go | 0 .../{v37 => v38}/github/admin_stats.go | 0 .../{v37 => v38}/github/admin_users.go | 0 .../go-github/{v37 => v38}/github/apps.go | 0 .../{v37 => v38}/github/apps_installation.go | 0 .../{v37 => v38}/github/apps_manifest.go | 1 + .../{v37 => v38}/github/apps_marketplace.go | 0 .../{v37 => v38}/github/authorizations.go | 0 .../go-github/{v37 => v38}/github/billing.go | 0 .../go-github/{v37 => v38}/github/checks.go | 2 + .../{v37 => v38}/github/code-scanning.go | 66 ++- .../go-github/{v37 => v38}/github/doc.go | 6 +- .../{v37 => v38}/github/enterprise.go | 0 .../github/enterprise_actions_runners.go | 0 .../github/enterprise_audit_log.go | 0 .../go-github/{v37 => v38}/github/event.go | 0 .../{v37 => v38}/github/event_types.go | 0 .../go-github/{v37 => v38}/github/gists.go | 0 .../{v37 => v38}/github/gists_comments.go | 0 .../go-github/{v37 => v38}/github/git.go | 0 .../{v37 => v38}/github/git_blobs.go | 0 .../{v37 => v38}/github/git_commits.go | 0 .../go-github/{v37 => v38}/github/git_refs.go | 0 .../go-github/{v37 => v38}/github/git_tags.go | 0 .../{v37 => v38}/github/git_trees.go | 0 .../{v37 => v38}/github/github-accessors.go | 410 +++++++++++++++++- .../go-github/{v37 => v38}/github/github.go | 50 ++- .../{v37 => v38}/github/gitignore.go | 0 .../{v37 => v38}/github/interactions.go | 0 .../{v37 => v38}/github/interactions_orgs.go | 0 .../{v37 => v38}/github/interactions_repos.go | 0 .../{v37 => v38}/github/issue_import.go | 0 .../go-github/{v37 => v38}/github/issues.go | 0 .../{v37 => v38}/github/issues_assignees.go | 0 .../{v37 => v38}/github/issues_comments.go | 0 .../{v37 => v38}/github/issues_events.go | 0 .../{v37 => v38}/github/issues_labels.go | 0 .../{v37 => v38}/github/issues_milestones.go | 0 .../{v37 => v38}/github/issues_timeline.go | 0 .../go-github/{v37 => v38}/github/licenses.go | 0 .../go-github/{v37 => v38}/github/messages.go | 81 ++-- .../{v37 => v38}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v37 => v38}/github/migrations_user.go | 0 .../go-github/{v37 => v38}/github/misc.go | 0 .../go-github/{v37 => v38}/github/orgs.go | 0 .../github/orgs_actions_allowed.go | 0 .../github/orgs_actions_permissions.go | 0 .../{v37 => v38}/github/orgs_audit_log.go | 0 .../{v37 => v38}/github/orgs_hooks.go | 0 .../v38/github/orgs_hooks_deliveries.go | 54 +++ .../{v37 => v38}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v37 => v38}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v37 => v38}/github/packages.go | 0 .../go-github/{v37 => v38}/github/projects.go | 0 .../go-github/{v37 => v38}/github/pulls.go | 0 .../{v37 => v38}/github/pulls_comments.go | 0 .../{v37 => v38}/github/pulls_reviewers.go | 0 .../{v37 => v38}/github/pulls_reviews.go | 0 .../{v37 => v38}/github/reactions.go | 0 .../go-github/{v37 => v38}/github/repos.go | 3 + .../github/repos_collaborators.go | 0 .../{v37 => v38}/github/repos_comments.go | 0 .../{v37 => v38}/github/repos_commits.go | 12 +- .../github/repos_community_health.go | 0 .../{v37 => v38}/github/repos_contents.go | 0 .../{v37 => v38}/github/repos_deployments.go | 0 .../{v37 => v38}/github/repos_environments.go | 0 .../{v37 => v38}/github/repos_forks.go | 0 .../{v37 => v38}/github/repos_hooks.go | 0 .../v38/github/repos_hooks_deliveries.go | 117 +++++ .../{v37 => v38}/github/repos_invitations.go | 0 .../{v37 => v38}/github/repos_keys.go | 0 .../{v37 => v38}/github/repos_merging.go | 0 .../{v37 => v38}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{v37 => v38}/github/repos_projects.go | 0 .../{v37 => v38}/github/repos_releases.go | 0 .../{v37 => v38}/github/repos_stats.go | 0 .../{v37 => v38}/github/repos_statuses.go | 3 + .../{v37 => v38}/github/repos_traffic.go | 0 .../go-github/{v37 => v38}/github/search.go | 0 .../go-github/{v37 => v38}/github/strings.go | 0 .../go-github/{v37 => v38}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{v37 => v38}/github/teams_discussions.go | 0 .../{v37 => v38}/github/teams_members.go | 0 .../{v37 => v38}/github/timestamp.go | 0 .../go-github/{v37 => v38}/github/users.go | 0 .../github/users_administration.go | 0 .../{v37 => v38}/github/users_blocking.go | 0 .../{v37 => v38}/github/users_emails.go | 0 .../{v37 => v38}/github/users_followers.go | 0 .../{v37 => v38}/github/users_gpg_keys.go | 0 .../{v37 => v38}/github/users_keys.go | 0 .../{v37 => v38}/github/users_projects.go | 0 .../{v37 => v38}/github/with_appengine.go | 0 .../{v37 => v38}/github/without_appengine.go | 0 vendor/modules.txt | 4 +- 166 files changed, 906 insertions(+), 144 deletions(-) rename vendor/github.com/google/go-github/{v37 => v38}/AUTHORS (94%) rename vendor/github.com/google/go-github/{v37 => v38}/LICENSE (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_artifacts.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_runner_groups.go (97%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_runners.go (84%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_secrets.go (99%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_workflow_jobs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_workflow_runs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/actions_workflows.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/admin.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/admin_orgs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/admin_users.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/apps.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/apps_manifest.go (96%) rename vendor/github.com/google/go-github/{v37 => v38}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/authorizations.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/billing.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/checks.go (99%) rename vendor/github.com/google/go-github/{v37 => v38}/github/code-scanning.go (56%) rename vendor/github.com/google/go-github/{v37 => v38}/github/doc.go (95%) rename vendor/github.com/google/go-github/{v37 => v38}/github/enterprise.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/enterprise_actions_runners.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/enterprise_audit_log.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/event.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/event_types.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/git.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/git_commits.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/github-accessors.go (97%) rename vendor/github.com/google/go-github/{v37 => v38}/github/github.go (96%) rename vendor/github.com/google/go-github/{v37 => v38}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issue_import.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/messages.go (81%) rename vendor/github.com/google/go-github/{v37 => v38}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_actions_permissions.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_audit_log.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_hooks.go (100%) create mode 100644 vendor/github.com/google/go-github/v38/github/orgs_hooks_deliveries.go rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/packages.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/projects.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/pulls.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos.go (99%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_commits.go (96%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_contents.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_environments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_hooks.go (100%) create mode 100644 vendor/github.com/google/go-github/v38/github/repos_hooks_deliveries.go rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_statuses.go (97%) rename vendor/github.com/google/go-github/{v37 => v38}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/search.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/teams.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/users_projects.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v37 => v38}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index 42a0cdc499..6cfb860788 100644 --- a/github/config.go +++ b/github/config.go @@ -2,12 +2,11 @@ package github import ( "context" - "log" "net/http" "net/url" "path" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" @@ -149,14 +148,9 @@ func (c *Config) Meta() (interface{}, error) { owner.v3client = v3client if c.Anonymous() { - log.Printf("[DEBUG] No token present; configuring anonymous owner.") return &owner, nil } else { - _, err = c.ConfigureOwner(&owner) - if err != nil { - return &owner, err - } - log.Printf("[DEBUG] Token present; configuring authenticated owner: %s", owner.name) - return &owner, nil + return c.ConfigureOwner(&owner) } + } diff --git a/github/data_source_github_branch.go b/github/data_source_github_branch.go index 04fa604bcd..82e00bafb9 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/v37/github" + "github.com/google/go-github/v38/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 618222eb49..1a82818a29 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index c72837fd4c..6188a90b04 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -4,7 +4,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/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 46aca23a5a..e6edc9a846 100644 --- a/github/data_source_github_organization_team_sync_groups.go +++ b/github/data_source_github_organization_team_sync_groups.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/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 da2413038c..d36ea84387 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -9,7 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/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 5ad148befd..e0c5008ad5 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index 94bf62befd..08f7954550 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/v37/github" + "github.com/google/go-github/v38/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 4d89c88f76..0492685b8a 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_actions_environment_secret.go b/github/resource_github_actions_environment_secret.go index b1a8ef403f..9ea6781229 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/v37/github" + "github.com/google/go-github/v38/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 1932a86a30..0eabae330b 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/v37/github" + "github.com/google/go-github/v38/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 20b4818861..ee1b4b09d4 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/v37/github" + "github.com/google/go-github/v38/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 a2b130caea..6b0e2a29e3 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index bc4e9fac88..d7335b163b 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/v37/github" + "github.com/google/go-github/v38/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 c463d53ca8..c46db01b4b 100644 --- a/github/resource_github_branch_default.go +++ b/github/resource_github_branch_default.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/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 787af1e7e5..071e2e8e99 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/v37/github" + "github.com/google/go-github/v38/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 3916a828a1..471a59f3e2 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/v37/github" + "github.com/google/go-github/v38/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 2749821e13..5cd51ab5c6 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 77e4dcb843..2642e85416 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/v37/github" + "github.com/google/go-github/v38/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 28793d14e5..70f5720f1b 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/v37/github" + "github.com/google/go-github/v38/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 8c19f82ba2..be376e4966 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/v37/github" + "github.com/google/go-github/v38/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 3416f5d419..e702c5eb0f 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/v37/github" + "github.com/google/go-github/v38/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 28c2687176..0a2b8874fd 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/v37/github" + "github.com/google/go-github/v38/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 0d30e50292..1bf3670788 100644 --- a/github/resource_github_project_card.go +++ b/github/resource_github_project_card.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/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 baffc09127..f4c8e9f0eb 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/v37/github" + "github.com/google/go-github/v38/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 204487b2cb..327f67b39a 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/v37/github" + "github.com/google/go-github/v38/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 7a9772f328..8ff2bddd97 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/v37/github" + "github.com/google/go-github/v38/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 668e3845f5..a3556d17d8 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/v37/github" + "github.com/google/go-github/v38/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 addc132c6d..97d061a9a4 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/v37/github" + "github.com/google/go-github/v38/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 1c50a34472..1d5f85c831 100644 --- a/github/resource_github_repository_environment.go +++ b/github/resource_github_repository_environment.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/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 fc395b9299..3671065c17 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -8,7 +8,7 @@ import ( "fmt" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -245,10 +245,14 @@ func resourceGithubRepositoryFileRead(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Fetching commit info for repository file: %s/%s/%s", owner, repo, file) var commit *github.RepositoryCommit + listOpts := &github.ListOptions{ + PerPage: maxPerPage, + } + // Use the SHA to lookup the commit info if we know it, otherwise loop through commits if sha, ok := d.GetOk("commit_sha"); ok { log.Printf("[DEBUG] Using known commit SHA: %s", sha.(string)) - commit, _, err = client.Repositories.GetCommit(ctx, owner, repo, sha.(string)) + commit, _, err = client.Repositories.GetCommit(ctx, owner, repo, sha.(string), listOpts) } else { log.Printf("[DEBUG] Commit SHA unknown for file: %s/%s/%s, looking for commit...", owner, repo, file) commit, err = getFileCommit(client, owner, repo, file, branch) @@ -331,7 +335,7 @@ func resourceGithubRepositoryFileDelete(d *schema.ResourceData, meta interface{} // checkRepositoryBranchExists tests if a branch exists in a repository. func checkRepositoryBranchExists(client *github.Client, owner, repo, branch string) error { ctx := context.WithValue(context.Background(), ctxId, buildTwoPartID(repo, branch)) - _, _, err := client.Repositories.GetBranch(ctx, owner, repo, branch, true) + _, _, err := client.Repositories.GetBranch(ctx, owner, repo, branch, false) if err != nil { if ghErr, ok := err.(*github.ErrorResponse); ok { if ghErr.Response.StatusCode == http.StatusNotFound { @@ -388,7 +392,10 @@ func getFileCommit(client *github.Client, owner, repo, file, branch string) (*gi continue } - rc, _, err := client.Repositories.GetCommit(ctx, owner, repo, sha) + listOpts := &github.ListOptions{ + PerPage: maxPerPage, + } + rc, _, err := client.Repositories.GetCommit(ctx, owner, repo, sha, listOpts) if err != nil { return nil, err } diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index 95b423491a..986eb10425 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/v37/github" + "github.com/google/go-github/v38/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 9d3ccba164..293557c531 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/v37/github" + "github.com/google/go-github/v38/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 18e0e9ddc9..c48625776c 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/v37/github" + "github.com/google/go-github/v38/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 51141bd236..40f1146b1b 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index cf6de5649f..4f51458fc2 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/shurcooL/githubv4" diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index 985038a4d9..c1b02d959a 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/v37/github" + "github.com/google/go-github/v38/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 88dd449872..4f47a20ca2 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/v37/github" + "github.com/google/go-github/v38/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 2bc8a4c0cd..a0b8aaff54 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -210,23 +210,6 @@ func resourceGithubTeamRepositoryDelete(d *schema.ResourceData, meta interface{} log.Printf("[DEBUG] Deleting team repository association: %s (%s/%s)", teamIdString, orgName, repoName) - resp, err := client.Teams.RemoveTeamRepoByID(ctx, orgId, teamId, orgName, repoName) - - if resp.Response.StatusCode == 404 { - log.Printf("[DEBUG] Failed to find team %s to delete for repo: %s.", teamIdString, repoName) - repo, _, err := client.Repositories.Get(ctx, orgName, repoName) - if err != nil { - return err - } - newRepoName := repo.GetName() - if newRepoName != repoName { - log.Printf("[DEBUG] Repo name has changed %s -> %s. "+ - "Try deleting team repository again.", - repoName, newRepoName) - _, err := client.Teams.RemoveTeamRepoByID(ctx, orgId, teamId, orgName, newRepoName) - return err - } - } - + _, err = client.Teams.RemoveTeamRepoByID(ctx, orgId, teamId, orgName, repoName) return err } diff --git a/github/resource_github_team_sync_group_mapping.go b/github/resource_github_team_sync_group_mapping.go index a0a35d1ee3..c5a2bec8a3 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/v37/github" + "github.com/google/go-github/v38/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 ff0a41bf7d..f47d05139d 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -206,7 +206,7 @@ resource "github_team" "test_team" { resource "github_team_sync_group_mapping" "test_mapping" { team_slug = github_team.test_team.slug - + dynamic "group" { for_each = [for g in data.github_organization_team_sync_groups.test_groups.groups : g if length(regexall("^acctest-github-provider", g.group_name)) > 0] content { @@ -214,7 +214,7 @@ resource "github_team_sync_group_mapping" "test_mapping" { group_name = group.value.group_name group_description = group.value.group_description } - } + } } `, teamName) } @@ -230,7 +230,7 @@ resource "github_team" "test_team" { resource "github_team_sync_group_mapping" "test_mapping" { team_slug = github_team.test_team.slug - + dynamic "group" { for_each = [for g in data.github_organization_team_sync_groups.test_groups.groups : g if length(regexall("^acctest-github-provider", g.group_name)) > 0] content { @@ -238,7 +238,7 @@ resource "github_team_sync_group_mapping" "test_mapping" { group_name = group.value.group_name group_description = "%s" } - } + } } `, teamName, description) } diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index 571e83373a..1ce4bb4b8b 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/v37/github" + "github.com/google/go-github/v38/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 a8acc44503..debdeae28d 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index 8a713c0d78..775897b27b 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/v37/github" + "github.com/google/go-github/v38/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 820dd7781c..f7002d0266 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index 421633692f..7c5338754a 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index 7b7af76ac1..acd41d2c7b 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v37/github" + "github.com/google/go-github/v38/github" ) const ( diff --git a/go.mod b/go.mod index 854756f4fd..aa9f8b60f0 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/v37 v37.0.0 + github.com/google/go-github/v38 v38.1.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 c0c812fff8..18db46bd02 100644 --- a/go.sum +++ b/go.sum @@ -157,10 +157,8 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v37 v36.0.0 h1:ndCzM616/oijwufI7nBRa+5eZHLldT+4yIB68ib5ogs= -github.com/google/go-github/v37 v36.0.0/go.mod h1:LFlKC047IOqiglRGNqNb9s/iAPTnnjtlshm+bxp+kwk= -github.com/google/go-github/v37 v37.0.0 h1:rCspN8/6kB1BAJWZfuafvHhyfIo5fkAulaP/3bOQ/tM= -github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4= +github.com/google/go-github/v38 v38.1.0 h1:C6h1FkaITcBFK7gAmq4eFzt6gbhEhk7L5z6R3Uva+po= +github.com/google/go-github/v38 v38.1.0/go.mod h1:cStvrz/7nFr0FoENgG6GLbp53WaelXucT+BBz/3VKx4= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= diff --git a/vendor/github.com/google/go-github/v37/AUTHORS b/vendor/github.com/google/go-github/v38/AUTHORS similarity index 94% rename from vendor/github.com/google/go-github/v37/AUTHORS rename to vendor/github.com/google/go-github/v38/AUTHORS index f8b2328dbe..2ae016f68c 100644 --- a/vendor/github.com/google/go-github/v37/AUTHORS +++ b/vendor/github.com/google/go-github/v38/AUTHORS @@ -26,6 +26,7 @@ Alex Bramley Alex Orr Alex Unger Alexander Harkness +Alexis Gauthiez Ali Farooq Allen Sun Amey Sakhadeo @@ -50,6 +51,7 @@ Arıl Bozoluk Asier Marruedo Austin Burdine Austin Dizzy +Azuka Okuleye Ben Batha Benjamen Keroack Beshr Kayali @@ -63,6 +65,7 @@ Brad Moylan Bradley Falzon Bradley McAllister Brandon Cook +Brett Logan Brian Egizi Bryan Boreham Cami Diez @@ -72,7 +75,9 @@ Carlos Tadeu Panato Junior chandresh-pancholi Charles Fenwick Elliott Charlie Yan +Chmouel Boudjnah Chris King +Chris Mc Chris Raborg Chris Roche Chris Schaefer @@ -89,6 +94,7 @@ Daniel Nilsson Daoq Dave Du Cros Dave Henderson +Dave Perrett Dave Protasowski David Deng David J. M. Karlsen @@ -97,6 +103,7 @@ David Ji David Lopez Reyes Davide Zipeto Dennis Webb +Derek Jobst Dhi Aurrahman Diego Lapiduz Dmitri Shuralyov @@ -114,6 +121,7 @@ Erick Fejta Erik Nobel erwinvaneyk Evan Elias +Fabian Holler Fabrice Felix Geisendörfer Filippo Valsorda @@ -140,6 +148,7 @@ haya14busa Huy Tr huydx i2bskn +Ikko Ashimine Ioannis Georgoulas Isao Jonas ishan upadhyay @@ -148,7 +157,9 @@ Jacob Valdemar Jake Krammer Jameel Haffejee James Cockbain +James Loh Jan Kosecki +Jan Švábík Javier Campanini Jef LeCompte Jens Rantil @@ -180,6 +191,7 @@ Katrina Owen Kautilya Tripathi Keita Urashima Kevin Burke +Kirill Konrad Malawski Kookheon Kwon Krzysztof Kowalczyk @@ -189,6 +201,7 @@ kyokomi Laurent Verdoïa Liam Galvin Lovro Mažgon +Luca Campese Lucas Alcantara Luke Evers Luke Kysow @@ -196,6 +209,7 @@ Luke Roberts Luke Young lynn [they] Maksim Zhylinski +Marc Binder Marcelo Carlos Mark Tareshawty Martin Holman @@ -204,6 +218,7 @@ Martins Sipenko Marwan Sulaiman Masayuki Izumi Mat Geist +Matin Rahmanian Matt Matt Brender Matt Gaunt @@ -215,6 +230,7 @@ Michael Tiller Michał Glapa Michelangelo Morrillo Mukundan Senthil +Munia Balayil Nadav Kaner Nathan VanBenschoten Navaneeth Suresh @@ -229,6 +245,7 @@ ns-cweber Ole Orhagen Oleg Kovalov Ondřej Kupka +Ori Talmor Pablo Pérez Schröder Palash Nigam Panagiotis Moustafellos @@ -265,11 +282,13 @@ Ricco Førgaard Rob Figueiredo Rohit Upadhyay Ronak Jain +Ross Gustafson Ruben Vereecken Russell Boley Ryan Leung Ryan Lower Ryo Nakao +Saaarah Safwan Olaimat Sahil Dua saisi @@ -332,4 +351,6 @@ Yannick Utard Yicheng Qin Yosuke Akatsuka Yumikiyo Osanai +Yusuke Kuoka Zach Latta +zhouhaibing089 diff --git a/vendor/github.com/google/go-github/v37/LICENSE b/vendor/github.com/google/go-github/v38/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v37/LICENSE rename to vendor/github.com/google/go-github/v38/LICENSE diff --git a/vendor/github.com/google/go-github/v37/github/actions.go b/vendor/github.com/google/go-github/v38/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/actions.go rename to vendor/github.com/google/go-github/v38/github/actions.go diff --git a/vendor/github.com/google/go-github/v37/github/actions_artifacts.go b/vendor/github.com/google/go-github/v38/github/actions_artifacts.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v38/github/actions_artifacts.go diff --git a/vendor/github.com/google/go-github/v37/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v38/github/actions_runner_groups.go similarity index 97% rename from vendor/github.com/google/go-github/v37/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v38/github/actions_runner_groups.go index 5772daaa75..e34495a960 100644 --- a/vendor/github.com/google/go-github/v37/github/actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v38/github/actions_runner_groups.go @@ -36,12 +36,15 @@ type CreateRunnerGroupRequest struct { SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"` // Runners represent a list of runner IDs to add to the runner group. Runners []int64 `json:"runners,omitempty"` + // If set to True, public repos can use this runner group + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` } // UpdateRunnerGroupRequest represents a request to update a Runner group for an organization. type UpdateRunnerGroupRequest struct { - Name *string `json:"name,omitempty"` - Visibility *string `json:"visibility,omitempty"` + Name *string `json:"name,omitempty"` + Visibility *string `json:"visibility,omitempty"` + AllowsPublicRepositories *bool `json:"allows_public_repositories,omitempty"` } // SetRepoAccessRunnerGroupRequest represents a request to replace the list of repositories diff --git a/vendor/github.com/google/go-github/v37/github/actions_runners.go b/vendor/github.com/google/go-github/v38/github/actions_runners.go similarity index 84% rename from vendor/github.com/google/go-github/v37/github/actions_runners.go rename to vendor/github.com/google/go-github/v38/github/actions_runners.go index 5bdebb3193..f37e1aa419 100644 --- a/vendor/github.com/google/go-github/v37/github/actions_runners.go +++ b/vendor/github.com/google/go-github/v38/github/actions_runners.go @@ -264,6 +264,65 @@ func (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string return repos, resp, nil } +// SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization.. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#set-selected-repositories-enabled-for-github-actions-in-an-organization +func (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories", owner) + + req, err := s.client.NewRequest("PUT", u, struct { + IDs []int64 `json:"selected_repository_ids"` + }{IDs: repositoryIDs}) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#enable-a-selected-repository-for-github-actions-in-an-organization +func (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) + + 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 +} + +// RemoveEnabledRepoInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#disable-a-selected-repository-for-github-actions-in-an-organization +func (s *ActionsService) RemoveEnabledRepoInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/repositories/%v", owner, repositoryID) + + 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 +} + // GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-self-hosted-runner-for-an-organization diff --git a/vendor/github.com/google/go-github/v37/github/actions_secrets.go b/vendor/github.com/google/go-github/v38/github/actions_secrets.go similarity index 99% rename from vendor/github.com/google/go-github/v37/github/actions_secrets.go rename to vendor/github.com/google/go-github/v38/github/actions_secrets.go index 379eab81cb..5bfb22ac08 100644 --- a/vendor/github.com/google/go-github/v37/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v38/github/actions_secrets.go @@ -302,7 +302,7 @@ func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, u := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) type repoIDs struct { - SelectedIDs SelectedRepoIDs `json:"selected_repository_ids,omitempty"` + SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` } req, err := s.client.NewRequest("PUT", u, repoIDs{SelectedIDs: ids}) diff --git a/vendor/github.com/google/go-github/v37/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v38/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v38/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v37/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v38/github/actions_workflow_runs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v38/github/actions_workflow_runs.go diff --git a/vendor/github.com/google/go-github/v37/github/actions_workflows.go b/vendor/github.com/google/go-github/v38/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/actions_workflows.go rename to vendor/github.com/google/go-github/v38/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v37/github/activity.go b/vendor/github.com/google/go-github/v38/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/activity.go rename to vendor/github.com/google/go-github/v38/github/activity.go diff --git a/vendor/github.com/google/go-github/v37/github/activity_events.go b/vendor/github.com/google/go-github/v38/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/activity_events.go rename to vendor/github.com/google/go-github/v38/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v37/github/activity_notifications.go b/vendor/github.com/google/go-github/v38/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/activity_notifications.go rename to vendor/github.com/google/go-github/v38/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v37/github/activity_star.go b/vendor/github.com/google/go-github/v38/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/activity_star.go rename to vendor/github.com/google/go-github/v38/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v37/github/activity_watching.go b/vendor/github.com/google/go-github/v38/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/activity_watching.go rename to vendor/github.com/google/go-github/v38/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v37/github/admin.go b/vendor/github.com/google/go-github/v38/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/admin.go rename to vendor/github.com/google/go-github/v38/github/admin.go diff --git a/vendor/github.com/google/go-github/v37/github/admin_orgs.go b/vendor/github.com/google/go-github/v38/github/admin_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/admin_orgs.go rename to vendor/github.com/google/go-github/v38/github/admin_orgs.go diff --git a/vendor/github.com/google/go-github/v37/github/admin_stats.go b/vendor/github.com/google/go-github/v38/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/admin_stats.go rename to vendor/github.com/google/go-github/v38/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v37/github/admin_users.go b/vendor/github.com/google/go-github/v38/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/admin_users.go rename to vendor/github.com/google/go-github/v38/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v37/github/apps.go b/vendor/github.com/google/go-github/v38/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/apps.go rename to vendor/github.com/google/go-github/v38/github/apps.go diff --git a/vendor/github.com/google/go-github/v37/github/apps_installation.go b/vendor/github.com/google/go-github/v38/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/apps_installation.go rename to vendor/github.com/google/go-github/v38/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v37/github/apps_manifest.go b/vendor/github.com/google/go-github/v38/github/apps_manifest.go similarity index 96% rename from vendor/github.com/google/go-github/v37/github/apps_manifest.go rename to vendor/github.com/google/go-github/v38/github/apps_manifest.go index defd6c0a0b..164f493999 100644 --- a/vendor/github.com/google/go-github/v37/github/apps_manifest.go +++ b/vendor/github.com/google/go-github/v38/github/apps_manifest.go @@ -13,6 +13,7 @@ import ( // AppConfig describes the configuration of a GitHub App. type AppConfig struct { ID *int64 `json:"id,omitempty"` + Slug *string `json:"slug,omitempty"` NodeID *string `json:"node_id,omitempty"` Owner *User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` diff --git a/vendor/github.com/google/go-github/v37/github/apps_marketplace.go b/vendor/github.com/google/go-github/v38/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v38/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v37/github/authorizations.go b/vendor/github.com/google/go-github/v38/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/authorizations.go rename to vendor/github.com/google/go-github/v38/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v37/github/billing.go b/vendor/github.com/google/go-github/v38/github/billing.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/billing.go rename to vendor/github.com/google/go-github/v38/github/billing.go diff --git a/vendor/github.com/google/go-github/v37/github/checks.go b/vendor/github.com/google/go-github/v38/github/checks.go similarity index 99% rename from vendor/github.com/google/go-github/v37/github/checks.go rename to vendor/github.com/google/go-github/v38/github/checks.go index cb8b847f38..07afb7c439 100644 --- a/vendor/github.com/google/go-github/v37/github/checks.go +++ b/vendor/github.com/google/go-github/v38/github/checks.go @@ -78,6 +78,8 @@ type CheckSuite struct { AfterSHA *string `json:"after,omitempty"` Status *string `json:"status,omitempty"` Conclusion *string `json:"conclusion,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` App *App `json:"app,omitempty"` Repository *Repository `json:"repository,omitempty"` PullRequests []*PullRequest `json:"pull_requests,omitempty"` diff --git a/vendor/github.com/google/go-github/v37/github/code-scanning.go b/vendor/github.com/google/go-github/v38/github/code-scanning.go similarity index 56% rename from vendor/github.com/google/go-github/v37/github/code-scanning.go rename to vendor/github.com/google/go-github/v38/github/code-scanning.go index 8602c44632..dbaeb346b3 100644 --- a/vendor/github.com/google/go-github/v37/github/code-scanning.go +++ b/vendor/github.com/google/go-github/v38/github/code-scanning.go @@ -18,9 +18,45 @@ import ( // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/code-scanning/ type CodeScanningService service +// Rule represents the complete details of GitHub Code Scanning alert type. +type Rule struct { + ID *string `json:"id,omitempty"` + Severity *string `json:"severity,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + SecuritySeverityLevel *string `json:"security_severity_level,omitempty"` + FullDescription *string `json:"full_description,omitempty"` + Tags []string `json:"tags,omitempty"` + Help *string `json:"help,omitempty"` +} + +// Location represents the exact location of the GitHub Code Scanning Alert in the scanned project. +type Location struct { + Path *string `json:"path,omitempty"` + StartLine *int `json:"start_line,omitempty"` + EndLine *int `json:"end_line,omitempty"` + StartColumn *int `json:"start_column,omitempty"` + EndColumn *int `json:"end_column,omitempty"` +} + +// Message is a part of MostRecentInstance struct which provides the appropriate message when any action is performed on the analysis object. +type Message struct { + Text *string `json:"text,omitempty"` +} + +// MostRecentInstance provides details of the most recent instance of this alert for the default branch or for the specified Git reference. +type MostRecentInstance struct { + Ref *string `json:"ref,omitempty"` + AnalysisKey *string `json:"analysis_key,omitempty"` + Environment *string `json:"environment,omitempty"` + State *string `json:"state,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + Message *Message `json:"message,omitempty"` + Location *Location `json:"location,omitempty"` + Classifications []string `json:"classifications,omitempty"` +} + // Tool represents the tool used to generate a GitHub Code Scanning Alert. -// -// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository type Tool struct { Name *string `json:"name,omitempty"` GUID *string `json:"guid,omitempty"` @@ -31,16 +67,22 @@ type Tool struct { // // GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-alerts-for-a-repository type Alert struct { - RuleID *string `json:"rule_id,omitempty"` - RuleSeverity *string `json:"rule_severity,omitempty"` - RuleDescription *string `json:"rule_description,omitempty"` - Tool *Tool `json:"tool,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - Open *bool `json:"open,omitempty"` - ClosedBy *User `json:"closed_by,omitempty"` - ClosedAt *Timestamp `json:"closed_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` + RuleID *string `json:"rule_id,omitempty"` + RuleSeverity *string `json:"rule_severity,omitempty"` + RuleDescription *string `json:"rule_description,omitempty"` + Rule *Rule `json:"rule,omitempty"` + Tool *Tool `json:"tool,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + State *string `json:"state,omitempty"` + ClosedBy *User `json:"closed_by,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + MostRecentInstance *MostRecentInstance `json:"most_recent_instance,omitempty"` + DismissedBy *User `json:"dismissed_by,omitempty"` + DismissedAt *Timestamp `json:"dismissed_at,omitempty"` + DismissedReason *string `json:"dismissed_reason,omitempty"` + InstancesURL *string `json:"instances_url,omitempty"` } // ID returns the ID associated with an alert. It is the number at the end of the security alert's URL. diff --git a/vendor/github.com/google/go-github/v37/github/doc.go b/vendor/github.com/google/go-github/v38/github/doc.go similarity index 95% rename from vendor/github.com/google/go-github/v37/github/doc.go rename to vendor/github.com/google/go-github/v38/github/doc.go index bd2e3ea063..8999a12687 100644 --- a/vendor/github.com/google/go-github/v37/github/doc.go +++ b/vendor/github.com/google/go-github/v38/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v37/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v38/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 @@ -112,7 +112,7 @@ To detect an API rate limit error, you can check if its type is *github.RateLimi } Learn more about GitHub rate limiting at -https://docs.github.com/en/free-pro-team@latest/rest/reference/#rate-limiting. +https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting. Accepted Status @@ -138,7 +138,7 @@ instead designed to work with a caching http.Transport. We recommend using https://github.com/gregjones/httpcache for that. Learn more about GitHub conditional requests at -https://docs.github.com/en/free-pro-team@latest/rest/reference/#conditional-requests. +https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#conditional-requests. Creating and Updating Resources diff --git a/vendor/github.com/google/go-github/v37/github/enterprise.go b/vendor/github.com/google/go-github/v38/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/enterprise.go rename to vendor/github.com/google/go-github/v38/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v37/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v38/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v38/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v37/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v38/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v38/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v37/github/event.go b/vendor/github.com/google/go-github/v38/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/event.go rename to vendor/github.com/google/go-github/v38/github/event.go diff --git a/vendor/github.com/google/go-github/v37/github/event_types.go b/vendor/github.com/google/go-github/v38/github/event_types.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/event_types.go rename to vendor/github.com/google/go-github/v38/github/event_types.go diff --git a/vendor/github.com/google/go-github/v37/github/gists.go b/vendor/github.com/google/go-github/v38/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/gists.go rename to vendor/github.com/google/go-github/v38/github/gists.go diff --git a/vendor/github.com/google/go-github/v37/github/gists_comments.go b/vendor/github.com/google/go-github/v38/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/gists_comments.go rename to vendor/github.com/google/go-github/v38/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v37/github/git.go b/vendor/github.com/google/go-github/v38/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/git.go rename to vendor/github.com/google/go-github/v38/github/git.go diff --git a/vendor/github.com/google/go-github/v37/github/git_blobs.go b/vendor/github.com/google/go-github/v38/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/git_blobs.go rename to vendor/github.com/google/go-github/v38/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v37/github/git_commits.go b/vendor/github.com/google/go-github/v38/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/git_commits.go rename to vendor/github.com/google/go-github/v38/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v37/github/git_refs.go b/vendor/github.com/google/go-github/v38/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/git_refs.go rename to vendor/github.com/google/go-github/v38/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v37/github/git_tags.go b/vendor/github.com/google/go-github/v38/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/git_tags.go rename to vendor/github.com/google/go-github/v38/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v37/github/git_trees.go b/vendor/github.com/google/go-github/v38/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/git_trees.go rename to vendor/github.com/google/go-github/v38/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v37/github/github-accessors.go b/vendor/github.com/google/go-github/v38/github/github-accessors.go similarity index 97% rename from vendor/github.com/google/go-github/v37/github/github-accessors.go rename to vendor/github.com/google/go-github/v38/github/github-accessors.go index 46efcc9c42..37a22830e6 100644 --- a/vendor/github.com/google/go-github/v37/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v38/github/github-accessors.go @@ -172,6 +172,30 @@ func (a *Alert) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise. +func (a *Alert) GetDismissedAt() Timestamp { + if a == nil || a.DismissedAt == nil { + return Timestamp{} + } + return *a.DismissedAt +} + +// GetDismissedBy returns the DismissedBy field. +func (a *Alert) GetDismissedBy() *User { + if a == nil { + return nil + } + return a.DismissedBy +} + +// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise. +func (a *Alert) GetDismissedReason() string { + if a == nil || a.DismissedReason == nil { + return "" + } + return *a.DismissedReason +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (a *Alert) GetHTMLURL() string { if a == nil || a.HTMLURL == nil { @@ -180,12 +204,28 @@ func (a *Alert) GetHTMLURL() string { return *a.HTMLURL } -// GetOpen returns the Open field if it's non-nil, zero value otherwise. -func (a *Alert) GetOpen() bool { - if a == nil || a.Open == nil { - return false +// GetInstancesURL returns the InstancesURL field if it's non-nil, zero value otherwise. +func (a *Alert) GetInstancesURL() string { + if a == nil || a.InstancesURL == nil { + return "" } - return *a.Open + return *a.InstancesURL +} + +// GetMostRecentInstance returns the MostRecentInstance field. +func (a *Alert) GetMostRecentInstance() *MostRecentInstance { + if a == nil { + return nil + } + return a.MostRecentInstance +} + +// GetRule returns the Rule field. +func (a *Alert) GetRule() *Rule { + if a == nil { + return nil + } + return a.Rule } // GetRuleDescription returns the RuleDescription field if it's non-nil, zero value otherwise. @@ -212,6 +252,14 @@ func (a *Alert) GetRuleSeverity() string { return *a.RuleSeverity } +// GetState returns the State field if it's non-nil, zero value otherwise. +func (a *Alert) GetState() string { + if a == nil || a.State == nil { + return "" + } + return *a.State +} + // GetTool returns the Tool field. func (a *Alert) GetTool() *Tool { if a == nil { @@ -412,6 +460,14 @@ func (a *AppConfig) GetPEM() string { return *a.PEM } +// GetSlug returns the Slug field if it's non-nil, zero value otherwise. +func (a *AppConfig) GetSlug() string { + if a == nil || a.Slug == nil { + return "" + } + return *a.Slug +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (a *AppConfig) GetUpdatedAt() Timestamp { if a == nil || a.UpdatedAt == nil { @@ -1612,6 +1668,14 @@ func (c *CheckSuite) GetConclusion() string { return *c.Conclusion } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + // GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. func (c *CheckSuite) GetHeadBranch() string { if c == nil || c.HeadBranch == nil { @@ -1668,6 +1732,14 @@ func (c *CheckSuite) GetStatus() string { return *c.Status } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (c *CheckSuite) GetURL() string { if c == nil || c.URL == nil { @@ -2900,6 +2972,14 @@ func (c *CreateOrgInvitationOptions) GetRole() string { return *c.Role } +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if c == nil || c.AllowsPublicRepositories == nil { + return false + } + return *c.AllowsPublicRepositories +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (c *CreateRunnerGroupRequest) GetName() string { if c == nil || c.Name == nil { @@ -4836,6 +4916,142 @@ func (h *HookConfig) GetURL() string { return *h.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetAction() string { + if h == nil || h.Action == nil { + return "" + } + return *h.Action +} + +// GetDeliveredAt returns the DeliveredAt field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetDeliveredAt() Timestamp { + if h == nil || h.DeliveredAt == nil { + return Timestamp{} + } + return *h.DeliveredAt +} + +// GetDuration returns the Duration field. +func (h *HookDelivery) GetDuration() *float64 { + if h == nil { + return nil + } + return h.Duration +} + +// GetEvent returns the Event field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetEvent() string { + if h == nil || h.Event == nil { + return "" + } + return *h.Event +} + +// GetGUID returns the GUID field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetGUID() string { + if h == nil || h.GUID == nil { + return "" + } + return *h.GUID +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetID() int64 { + if h == nil || h.ID == nil { + return 0 + } + return *h.ID +} + +// GetInstallationID returns the InstallationID field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetInstallationID() string { + if h == nil || h.InstallationID == nil { + return "" + } + return *h.InstallationID +} + +// GetRedelivery returns the Redelivery field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetRedelivery() bool { + if h == nil || h.Redelivery == nil { + return false + } + return *h.Redelivery +} + +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetRepositoryID() int64 { + if h == nil || h.RepositoryID == nil { + return 0 + } + return *h.RepositoryID +} + +// GetRequest returns the Request field. +func (h *HookDelivery) GetRequest() *HookRequest { + if h == nil { + return nil + } + return h.Request +} + +// GetResponse returns the Response field. +func (h *HookDelivery) GetResponse() *HookResponse { + if h == nil { + return nil + } + return h.Response +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetStatus() string { + if h == nil || h.Status == nil { + return "" + } + return *h.Status +} + +// GetStatusCode returns the StatusCode field if it's non-nil, zero value otherwise. +func (h *HookDelivery) GetStatusCode() int { + if h == nil || h.StatusCode == nil { + return 0 + } + return *h.StatusCode +} + +// GetHeaders returns the Headers map if it's non-nil, an empty map otherwise. +func (h *HookRequest) GetHeaders() map[string]string { + if h == nil || h.Headers == nil { + return map[string]string{} + } + return h.Headers +} + +// GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise. +func (h *HookRequest) GetRawPayload() json.RawMessage { + if h == nil || h.RawPayload == nil { + return json.RawMessage{} + } + return *h.RawPayload +} + +// GetHeaders returns the Headers map if it's non-nil, an empty map otherwise. +func (h *HookResponse) GetHeaders() map[string]string { + if h == nil || h.Headers == nil { + return map[string]string{} + } + return h.Headers +} + +// GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise. +func (h *HookResponse) GetRawPayload() json.RawMessage { + if h == nil || h.RawPayload == nil { + return json.RawMessage{} + } + return *h.RawPayload +} + // GetActiveHooks returns the ActiveHooks field if it's non-nil, zero value otherwise. func (h *HookStats) GetActiveHooks() int { if h == nil || h.ActiveHooks == nil { @@ -6956,6 +7172,46 @@ func (l *ListRepositories) GetTotalCount() int { return *l.TotalCount } +// GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise. +func (l *Location) GetEndColumn() int { + if l == nil || l.EndColumn == nil { + return 0 + } + return *l.EndColumn +} + +// GetEndLine returns the EndLine field if it's non-nil, zero value otherwise. +func (l *Location) GetEndLine() int { + if l == nil || l.EndLine == nil { + return 0 + } + return *l.EndLine +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (l *Location) GetPath() string { + if l == nil || l.Path == nil { + return "" + } + return *l.Path +} + +// GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise. +func (l *Location) GetStartColumn() int { + if l == nil || l.StartColumn == nil { + return 0 + } + return *l.StartColumn +} + +// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise. +func (l *Location) GetStartLine() int { + if l == nil || l.StartLine == nil { + return 0 + } + return *l.StartLine +} + // GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. func (m *MarketplacePendingChange) GetEffectiveDate() Timestamp { if m == nil || m.EffectiveDate == nil { @@ -7404,6 +7660,14 @@ func (m *MembershipEvent) GetTeam() *Team { return m.Team } +// GetText returns the Text field if it's non-nil, zero value otherwise. +func (m *Message) GetText() string { + if m == nil || m.Text == nil { + return "" + } + return *m.Text +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (m *MetaEvent) GetAction() string { if m == nil || m.Action == nil { @@ -7732,6 +7996,62 @@ func (m *MilestoneStats) GetTotalMilestones() int { return *m.TotalMilestones } +// GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetAnalysisKey() string { + if m == nil || m.AnalysisKey == nil { + return "" + } + return *m.AnalysisKey +} + +// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetCommitSHA() string { + if m == nil || m.CommitSHA == nil { + return "" + } + return *m.CommitSHA +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetEnvironment() string { + if m == nil || m.Environment == nil { + return "" + } + return *m.Environment +} + +// GetLocation returns the Location field. +func (m *MostRecentInstance) GetLocation() *Location { + if m == nil { + return nil + } + return m.Location +} + +// GetMessage returns the Message field. +func (m *MostRecentInstance) GetMessage() *Message { + if m == nil { + return nil + } + return m.Message +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetRef() string { + if m == nil || m.Ref == nil { + return "" + } + return *m.Ref +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (m *MostRecentInstance) GetState() string { + if m == nil || m.State == nil { + return "" + } + return *m.State +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetBase() string { if n == nil || n.Base == nil { @@ -10052,6 +10372,14 @@ func (p *ProtectionRequest) GetAllowForcePushes() bool { return *p.AllowForcePushes } +// GetRequiredConversationResolution returns the RequiredConversationResolution field if it's non-nil, zero value otherwise. +func (p *ProtectionRequest) GetRequiredConversationResolution() bool { + if p == nil || p.RequiredConversationResolution == nil { + return false + } + return *p.RequiredConversationResolution +} + // GetRequiredPullRequestReviews returns the RequiredPullRequestReviews field. func (p *ProtectionRequest) GetRequiredPullRequestReviews() *PullRequestReviewsEnforcementRequest { if p == nil { @@ -13892,6 +14220,14 @@ func (r *RepoStats) GetTotalWikis() int { return *r.TotalWikis } +// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. +func (r *RepoStatus) GetAvatarURL() string { + if r == nil || r.AvatarURL == nil { + return "" + } + return *r.AvatarURL +} + // GetContext returns the Context field if it's non-nil, zero value otherwise. func (r *RepoStatus) GetContext() string { if r == nil || r.Context == nil { @@ -13996,6 +14332,62 @@ func (r *ReviewersRequest) GetNodeID() string { return *r.NodeID } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (r *Rule) GetDescription() string { + if r == nil || r.Description == nil { + return "" + } + return *r.Description +} + +// GetFullDescription returns the FullDescription field if it's non-nil, zero value otherwise. +func (r *Rule) GetFullDescription() string { + if r == nil || r.FullDescription == nil { + return "" + } + return *r.FullDescription +} + +// GetHelp returns the Help field if it's non-nil, zero value otherwise. +func (r *Rule) GetHelp() string { + if r == nil || r.Help == nil { + return "" + } + return *r.Help +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *Rule) GetID() string { + if r == nil || r.ID == nil { + return "" + } + return *r.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *Rule) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetSecuritySeverityLevel returns the SecuritySeverityLevel field if it's non-nil, zero value otherwise. +func (r *Rule) GetSecuritySeverityLevel() string { + if r == nil || r.SecuritySeverityLevel == nil { + return "" + } + return *r.SecuritySeverityLevel +} + +// GetSeverity returns the Severity field if it's non-nil, zero value otherwise. +func (r *Rule) GetSeverity() string { + if r == nil || r.Severity == nil { + return "" + } + return *r.Severity +} + // GetBusy returns the Busy field if it's non-nil, zero value otherwise. func (r *Runner) GetBusy() bool { if r == nil || r.Busy == nil { @@ -15764,6 +16156,14 @@ func (u *UpdateCheckRunOptions) GetStatus() string { return *u.Status } +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if u == nil || u.AllowsPublicRepositories == nil { + return false + } + return *u.AllowsPublicRepositories +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetName() string { if u == nil || u.Name == nil { diff --git a/vendor/github.com/google/go-github/v37/github/github.go b/vendor/github.com/google/go-github/v38/github/github.go similarity index 96% rename from vendor/github.com/google/go-github/v37/github/github.go rename to vendor/github.com/google/go-github/v38/github/github.go index 264e27f476..fe686857ad 100644 --- a/vendor/github.com/google/go-github/v37/github/github.go +++ b/vendor/github.com/google/go-github/v38/github/github.go @@ -37,6 +37,8 @@ const ( headerRateReset = "X-RateLimit-Reset" headerOTP = "X-GitHub-OTP" + headerTokenExpiration = "GitHub-Authentication-Token-Expiration" + mediaTypeV3 = "application/vnd.github.v3+json" defaultMediaType = "application/octet-stream" mediaTypeV3SHA = "application/vnd.github.v3.sha" @@ -188,6 +190,14 @@ type service struct { client *Client } +// Client returns the http.Client used by this GitHub client. +func (c *Client) Client() *http.Client { + c.clientMu.Lock() + defer c.clientMu.Unlock() + clientCopy := *c.client + return &clientCopy +} + // ListOptions specifies the optional parameters to various List methods that // support offset pagination. type ListOptions struct { @@ -212,6 +222,9 @@ type ListCursorOptions struct { // A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. Before string `url:"before,omitempty"` + + // A cursor, as given in the Link header. If specified, the query continues the search using this cursor. + Cursor string `url:"cursor,omitempty"` } // UploadOptions specifies the parameters to methods that support uploads. @@ -445,9 +458,17 @@ type Response struct { // calling the endpoint again. NextPageToken string + // For APIs that support cursor pagination, such as RepositoryService.ListRepositoryHookDeliveries, + // the following field will be populated to point to the next page. + // Set ListCursorOptions.Cursor to this value when calling the endpoint again. + Cursor string + // Explicitly specify the Rate type so Rate's String() receiver doesn't // propagate to Response. Rate Rate + + // token's expiration date + TokenExpiration Timestamp } // newResponse creates a new Response for the provided http.Response. @@ -456,6 +477,7 @@ func newResponse(r *http.Response) *Response { response := &Response{Response: r} response.populatePageValues() response.Rate = parseRate(r) + response.TokenExpiration = parseTokenExpiration(r) return response } @@ -481,7 +503,21 @@ func (r *Response) populatePageValues() { if err != nil { continue } - page := url.Query().Get("page") + + q := url.Query() + + if cursor := q.Get("cursor"); cursor != "" { + for _, segment := range segments[1:] { + switch strings.TrimSpace(segment) { + case `rel="next"`: + r.Cursor = cursor + } + } + + continue + } + + page := q.Get("page") if page == "" { continue } @@ -499,7 +535,6 @@ func (r *Response) populatePageValues() { case `rel="last"`: r.LastPage, _ = strconv.Atoi(page) } - } } } @@ -522,6 +557,17 @@ func parseRate(r *http.Response) Rate { return rate } +// parseTokenExpiration parses the TokenExpiration related headers. +func parseTokenExpiration(r *http.Response) Timestamp { + var exp Timestamp + if v := r.Header.Get(headerTokenExpiration); v != "" { + if t, err := time.Parse("2006-01-02 03:04:05 MST", v); err == nil { + exp = Timestamp{t.Local()} + } + } + return exp +} + type requestContext uint8 const ( diff --git a/vendor/github.com/google/go-github/v37/github/gitignore.go b/vendor/github.com/google/go-github/v38/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/gitignore.go rename to vendor/github.com/google/go-github/v38/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v37/github/interactions.go b/vendor/github.com/google/go-github/v38/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/interactions.go rename to vendor/github.com/google/go-github/v38/github/interactions.go diff --git a/vendor/github.com/google/go-github/v37/github/interactions_orgs.go b/vendor/github.com/google/go-github/v38/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v38/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v37/github/interactions_repos.go b/vendor/github.com/google/go-github/v38/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/interactions_repos.go rename to vendor/github.com/google/go-github/v38/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v37/github/issue_import.go b/vendor/github.com/google/go-github/v38/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issue_import.go rename to vendor/github.com/google/go-github/v38/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v37/github/issues.go b/vendor/github.com/google/go-github/v38/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues.go rename to vendor/github.com/google/go-github/v38/github/issues.go diff --git a/vendor/github.com/google/go-github/v37/github/issues_assignees.go b/vendor/github.com/google/go-github/v38/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues_assignees.go rename to vendor/github.com/google/go-github/v38/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v37/github/issues_comments.go b/vendor/github.com/google/go-github/v38/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues_comments.go rename to vendor/github.com/google/go-github/v38/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v37/github/issues_events.go b/vendor/github.com/google/go-github/v38/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues_events.go rename to vendor/github.com/google/go-github/v38/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v37/github/issues_labels.go b/vendor/github.com/google/go-github/v38/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues_labels.go rename to vendor/github.com/google/go-github/v38/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v37/github/issues_milestones.go b/vendor/github.com/google/go-github/v38/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues_milestones.go rename to vendor/github.com/google/go-github/v38/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v37/github/issues_timeline.go b/vendor/github.com/google/go-github/v38/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/issues_timeline.go rename to vendor/github.com/google/go-github/v38/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v37/github/licenses.go b/vendor/github.com/google/go-github/v38/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/licenses.go rename to vendor/github.com/google/go-github/v38/github/licenses.go diff --git a/vendor/github.com/google/go-github/v37/github/messages.go b/vendor/github.com/google/go-github/v38/github/messages.go similarity index 81% rename from vendor/github.com/google/go-github/v37/github/messages.go rename to vendor/github.com/google/go-github/v38/github/messages.go index 06ea9e4cfe..caa596a217 100644 --- a/vendor/github.com/google/go-github/v37/github/messages.go +++ b/vendor/github.com/google/go-github/v38/github/messages.go @@ -18,6 +18,7 @@ import ( "errors" "fmt" "hash" + "io" "io/ioutil" "mime" "net/http" @@ -31,14 +32,14 @@ const ( // sha256Prefix and sha512Prefix are provided for future compatibility. sha256Prefix = "sha256" sha512Prefix = "sha512" - // sha1SignatureHeader is the GitHub header key used to pass the HMAC-SHA1 hexdigest. - sha1SignatureHeader = "X-Hub-Signature" - // sha256SignatureHeader is the GitHub header key used to pass the HMAC-SHA256 hexdigest. - sha256SignatureHeader = "X-Hub-Signature-256" - // eventTypeHeader is the GitHub header key used to pass the event type. - eventTypeHeader = "X-Github-Event" - // deliveryIDHeader is the GitHub header key used to pass the unique ID for the webhook event. - deliveryIDHeader = "X-Github-Delivery" + // SHA1SignatureHeader is the GitHub header key used to pass the HMAC-SHA1 hexdigest. + SHA1SignatureHeader = "X-Hub-Signature" + // SHA256SignatureHeader is the GitHub header key used to pass the HMAC-SHA256 hexdigest. + SHA256SignatureHeader = "X-Hub-Signature-256" + // EventTypeHeader is the GitHub header key used to pass the event type. + EventTypeHeader = "X-Github-Event" + // DeliveryIDHeader is the GitHub header key used to pass the unique ID for the webhook event. + DeliveryIDHeader = "X-Github-Delivery" ) var ( @@ -139,7 +140,7 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { return buf, hashFunc, nil } -// ValidatePayload validates an incoming GitHub Webhook event request +// ValidatePayload validates an incoming GitHub Webhook event request body // and returns the (JSON) payload. // The Content-Type header of the payload can be "application/json" or "application/x-www-form-urlencoded". // If the Content-Type is neither then an error is returned. @@ -150,25 +151,19 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// // 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 ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { +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. - ct := r.Header.Get("Content-Type") - - mediatype, _, err := mime.ParseMediaType(ct) - if err != nil { - mediatype = "" - } - - switch mediatype { + switch contentType { case "application/json": var err error - if body, err = ioutil.ReadAll(r.Body); err != nil { + if body, err = ioutil.ReadAll(readable); err != nil { return nil, err } @@ -182,7 +177,7 @@ func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err e const payloadFormParam = "payload" var err error - if body, err = ioutil.ReadAll(r.Body); err != nil { + if body, err = ioutil.ReadAll(readable); err != nil { return nil, err } @@ -195,17 +190,13 @@ func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err e payload = []byte(form.Get(payloadFormParam)) default: - return nil, fmt.Errorf("Webhook request has unsupported Content-Type %q", ct) + return nil, fmt.Errorf("Webhook request has unsupported Content-Type %q", contentType) } // Only validate the signature if a secret token exists. This is intended for // local development only and all webhooks should ideally set up a secret token. if len(secretToken) > 0 { - sig := r.Header.Get(sha256SignatureHeader) - if sig == "" { - sig = r.Header.Get(sha1SignatureHeader) - } - if err := ValidateSignature(sig, body, secretToken); err != nil { + if err := ValidateSignature(signature, body, secretToken); err != nil { return nil, err } } @@ -213,6 +204,36 @@ func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err e return payload, nil } +// ValidatePayload validates an incoming GitHub Webhook event request +// and returns the (JSON) payload. +// The Content-Type header of the payload can be "application/json" or "application/x-www-form-urlencoded". +// If the Content-Type is neither then an error is returned. +// secretToken is the GitHub Webhook secret token. +// If your webhook does not contain a secret token, you can pass nil or an empty slice. +// This is intended for local development purposes only and all webhooks should ideally set up a secret token. +// +// 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 ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { + signature := r.Header.Get(SHA256SignatureHeader) + if signature == "" { + signature = r.Header.Get(SHA1SignatureHeader) + } + + contentType, _, err := mime.ParseMediaType(r.Header.Get("Content-Type")) + if err != nil { + return nil, err + } + + return ValidatePayloadFromBody(contentType, r.Body, signature, secretToken) +} + // ValidateSignature validates the signature for the given payload. // signature is the GitHub hash signature delivered in the X-Hub-Signature header. // payload is the JSON payload sent by GitHub Webhooks. @@ -234,14 +255,14 @@ func ValidateSignature(signature string, payload, secretToken []byte) error { // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/hooks/#webhook-headers func WebHookType(r *http.Request) string { - return r.Header.Get(eventTypeHeader) + return r.Header.Get(EventTypeHeader) } // DeliveryID returns the unique delivery ID of webhook request r. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/hooks/#webhook-headers func DeliveryID(r *http.Request) string { - return r.Header.Get(deliveryIDHeader) + return r.Header.Get(DeliveryIDHeader) } // ParseWebHook parses the event payload. For recognized event types, a diff --git a/vendor/github.com/google/go-github/v37/github/migrations.go b/vendor/github.com/google/go-github/v38/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/migrations.go rename to vendor/github.com/google/go-github/v38/github/migrations.go diff --git a/vendor/github.com/google/go-github/v37/github/migrations_source_import.go b/vendor/github.com/google/go-github/v38/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v38/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v37/github/migrations_user.go b/vendor/github.com/google/go-github/v38/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/migrations_user.go rename to vendor/github.com/google/go-github/v38/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v37/github/misc.go b/vendor/github.com/google/go-github/v38/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/misc.go rename to vendor/github.com/google/go-github/v38/github/misc.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs.go b/vendor/github.com/google/go-github/v38/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs.go rename to vendor/github.com/google/go-github/v38/github/orgs.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v38/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v38/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v38/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v38/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v38/github/orgs_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v38/github/orgs_audit_log.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_hooks.go b/vendor/github.com/google/go-github/v38/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v38/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v38/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v38/github/orgs_hooks_deliveries.go new file mode 100644 index 0000000000..6ab2d7aa24 --- /dev/null +++ b/vendor/github.com/google/go-github/v38/github/orgs_hooks_deliveries.go @@ -0,0 +1,54 @@ +// Copyright 2021 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" +) + +// ListHookDeliveries lists webhook deliveries for a webhook configured in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#list-deliveries-for-an-organization-webhook +func (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { + u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries", org, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + deliveries := []*HookDelivery{} + resp, err := s.client.Do(ctx, req, &deliveries) + if err != nil { + return nil, resp, err + } + + return deliveries, resp, nil +} + +// GetHookDelivery returns a delivery for a webhook configured in an organization. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/orgs#get-a-webhook-delivery-for-an-organization-webhook +func (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { + u := fmt.Sprintf("orgs/%v/hooks/%v/deliveries/%v", owner, hookID, deliveryID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + h := new(HookDelivery) + resp, err := s.client.Do(ctx, req, h) + if err != nil { + return nil, resp, err + } + + return h, resp, nil +} diff --git a/vendor/github.com/google/go-github/v37/github/orgs_members.go b/vendor/github.com/google/go-github/v38/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_members.go rename to vendor/github.com/google/go-github/v38/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v38/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v38/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_projects.go b/vendor/github.com/google/go-github/v38/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_projects.go rename to vendor/github.com/google/go-github/v38/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v37/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v38/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v38/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v37/github/packages.go b/vendor/github.com/google/go-github/v38/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/packages.go rename to vendor/github.com/google/go-github/v38/github/packages.go diff --git a/vendor/github.com/google/go-github/v37/github/projects.go b/vendor/github.com/google/go-github/v38/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/projects.go rename to vendor/github.com/google/go-github/v38/github/projects.go diff --git a/vendor/github.com/google/go-github/v37/github/pulls.go b/vendor/github.com/google/go-github/v38/github/pulls.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/pulls.go rename to vendor/github.com/google/go-github/v38/github/pulls.go diff --git a/vendor/github.com/google/go-github/v37/github/pulls_comments.go b/vendor/github.com/google/go-github/v38/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/pulls_comments.go rename to vendor/github.com/google/go-github/v38/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v37/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v38/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v38/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v37/github/pulls_reviews.go b/vendor/github.com/google/go-github/v38/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v38/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v37/github/reactions.go b/vendor/github.com/google/go-github/v38/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/reactions.go rename to vendor/github.com/google/go-github/v38/github/reactions.go diff --git a/vendor/github.com/google/go-github/v37/github/repos.go b/vendor/github.com/google/go-github/v38/github/repos.go similarity index 99% rename from vendor/github.com/google/go-github/v37/github/repos.go rename to vendor/github.com/google/go-github/v38/github/repos.go index d336e8bf77..eaadbb4375 100644 --- a/vendor/github.com/google/go-github/v37/github/repos.go +++ b/vendor/github.com/google/go-github/v38/github/repos.go @@ -776,6 +776,9 @@ type ProtectionRequest struct { AllowForcePushes *bool `json:"allow_force_pushes,omitempty"` // Allows deletion of the protected branch by anyone with write access to the repository. AllowDeletions *bool `json:"allow_deletions,omitempty"` + // RequiredConversationResolution, if set to true, requires all comments + // on the pull request to be resolved before it can be merged to a protected branch. + RequiredConversationResolution *bool `json:"required_conversation_resolution,omitempty"` } // RequiredStatusChecks represents the protection status of a individual branch. diff --git a/vendor/github.com/google/go-github/v37/github/repos_collaborators.go b/vendor/github.com/google/go-github/v38/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v38/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_comments.go b/vendor/github.com/google/go-github/v38/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_comments.go rename to vendor/github.com/google/go-github/v38/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_commits.go b/vendor/github.com/google/go-github/v38/github/repos_commits.go similarity index 96% rename from vendor/github.com/google/go-github/v37/github/repos_commits.go rename to vendor/github.com/google/go-github/v38/github/repos_commits.go index b49a5afeed..ce3b48e3c5 100644 --- a/vendor/github.com/google/go-github/v37/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v38/github/repos_commits.go @@ -150,8 +150,12 @@ func (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo strin // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-single-commit // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-a-commit -func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string) (*RepositoryCommit, *Response, error) { +func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -224,11 +228,15 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // CompareCommits compares a range of commits with each other. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#compare-two-commits -func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string) (*CommitsComparison, *Response, error) { +func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) u := fmt.Sprintf("repos/%v/%v/compare/%v...%v", owner, repo, escapedBase, escapedHead) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v37/github/repos_community_health.go b/vendor/github.com/google/go-github/v38/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_community_health.go rename to vendor/github.com/google/go-github/v38/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_contents.go b/vendor/github.com/google/go-github/v38/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_contents.go rename to vendor/github.com/google/go-github/v38/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_deployments.go b/vendor/github.com/google/go-github/v38/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_deployments.go rename to vendor/github.com/google/go-github/v38/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_environments.go b/vendor/github.com/google/go-github/v38/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_environments.go rename to vendor/github.com/google/go-github/v38/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_forks.go b/vendor/github.com/google/go-github/v38/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_forks.go rename to vendor/github.com/google/go-github/v38/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_hooks.go b/vendor/github.com/google/go-github/v38/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_hooks.go rename to vendor/github.com/google/go-github/v38/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v38/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v38/github/repos_hooks_deliveries.go new file mode 100644 index 0000000000..122674463a --- /dev/null +++ b/vendor/github.com/google/go-github/v38/github/repos_hooks_deliveries.go @@ -0,0 +1,117 @@ +// Copyright 2021 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" + "encoding/json" + "fmt" +) + +// HookDelivery represents the data that is received from GitHub's Webhook Delivery API +// +// GitHub API docs: +// - https://docs.github.com/en/rest/reference/repos#list-deliveries-for-a-repository-webhook +// - https://docs.github.com/en/rest/reference/repos#get-a-delivery-for-a-repository-webhook +type HookDelivery struct { + ID *int64 `json:"id"` + GUID *string `json:"guid"` + DeliveredAt *Timestamp `json:"delivered_at"` + Redelivery *bool `json:"redelivery"` + Duration *float64 `json:"duration"` + Status *string `json:"status"` + StatusCode *int `json:"status_code"` + Event *string `json:"event"` + Action *string `json:"action"` + InstallationID *string `json:"installation_id"` + RepositoryID *int64 `json:"repository_id"` + + // Request is populated by GetHookDelivery. + Request *HookRequest `json:"request,omitempty"` + // Response is populated by GetHookDelivery. + Response *HookResponse `json:"response,omitempty"` +} + +func (d HookDelivery) String() string { + return Stringify(d) +} + +// HookRequest is a part of HookDelivery that contains +// the HTTP headers and the JSON payload of the webhook request. +type HookRequest struct { + Headers map[string]string `json:"headers,omitempty"` + RawPayload *json.RawMessage `json:"payload,omitempty"` +} + +func (r HookRequest) String() string { + return Stringify(r) +} + +// HookResponse is a part of HookDelivery that contains +// the HTTP headers and the response body served by the webhook endpoint. +type HookResponse struct { + Headers map[string]string `json:"headers,omitempty"` + RawPayload *json.RawMessage `json:"payload,omitempty"` +} + +func (r HookResponse) String() string { + return Stringify(r) +} + +// ListHookDeliveries lists webhook deliveries for a webhook configured in a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/repos#list-deliveries-for-a-repository-webhook +func (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries", owner, repo, id) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + deliveries := []*HookDelivery{} + resp, err := s.client.Do(ctx, req, &deliveries) + if err != nil { + return nil, resp, err + } + + return deliveries, resp, nil +} + +// GetHookDelivery returns a delivery for a webhook configured in a repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-a-delivery-for-a-repository-webhook +func (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/hooks/%v/deliveries/%v", owner, repo, hookID, deliveryID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + h := new(HookDelivery) + resp, err := s.client.Do(ctx, req, h) + if err != nil { + return nil, resp, err + } + + return h, resp, nil +} + +// ParseRequestPayload parses the request payload. For recognized event types, +// a value of the corresponding struct type will be returned. +func (d *HookDelivery) ParseRequestPayload() (interface{}, error) { + eType, ok := eventTypeMapping[*d.Event] + if !ok { + return nil, fmt.Errorf("unsupported event type %q", *d.Event) + } + + e := &Event{Type: &eType, RawPayload: d.Request.RawPayload} + return e.ParsePayload() +} diff --git a/vendor/github.com/google/go-github/v37/github/repos_invitations.go b/vendor/github.com/google/go-github/v38/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_invitations.go rename to vendor/github.com/google/go-github/v38/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_keys.go b/vendor/github.com/google/go-github/v38/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_keys.go rename to vendor/github.com/google/go-github/v38/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_merging.go b/vendor/github.com/google/go-github/v38/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_merging.go rename to vendor/github.com/google/go-github/v38/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_pages.go b/vendor/github.com/google/go-github/v38/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_pages.go rename to vendor/github.com/google/go-github/v38/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v38/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v38/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_projects.go b/vendor/github.com/google/go-github/v38/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_projects.go rename to vendor/github.com/google/go-github/v38/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_releases.go b/vendor/github.com/google/go-github/v38/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_releases.go rename to vendor/github.com/google/go-github/v38/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_stats.go b/vendor/github.com/google/go-github/v38/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_stats.go rename to vendor/github.com/google/go-github/v38/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v37/github/repos_statuses.go b/vendor/github.com/google/go-github/v38/github/repos_statuses.go similarity index 97% rename from vendor/github.com/google/go-github/v37/github/repos_statuses.go rename to vendor/github.com/google/go-github/v38/github/repos_statuses.go index 32929ba351..347d856ae2 100644 --- a/vendor/github.com/google/go-github/v37/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/v38/github/repos_statuses.go @@ -31,6 +31,9 @@ type RepoStatus struct { // A string label to differentiate this status from the statuses of other systems. Context *string `json:"context,omitempty"` + // AvatarURL is the URL of the avatar of this status. + AvatarURL *string `json:"avatar_url,omitempty"` + Creator *User `json:"creator,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` diff --git a/vendor/github.com/google/go-github/v37/github/repos_traffic.go b/vendor/github.com/google/go-github/v38/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/repos_traffic.go rename to vendor/github.com/google/go-github/v38/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v37/github/search.go b/vendor/github.com/google/go-github/v38/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/search.go rename to vendor/github.com/google/go-github/v38/github/search.go diff --git a/vendor/github.com/google/go-github/v37/github/strings.go b/vendor/github.com/google/go-github/v38/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/strings.go rename to vendor/github.com/google/go-github/v38/github/strings.go diff --git a/vendor/github.com/google/go-github/v37/github/teams.go b/vendor/github.com/google/go-github/v38/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/teams.go rename to vendor/github.com/google/go-github/v38/github/teams.go diff --git a/vendor/github.com/google/go-github/v37/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v38/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v38/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v37/github/teams_discussions.go b/vendor/github.com/google/go-github/v38/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/teams_discussions.go rename to vendor/github.com/google/go-github/v38/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v37/github/teams_members.go b/vendor/github.com/google/go-github/v38/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/teams_members.go rename to vendor/github.com/google/go-github/v38/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v37/github/timestamp.go b/vendor/github.com/google/go-github/v38/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/timestamp.go rename to vendor/github.com/google/go-github/v38/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v37/github/users.go b/vendor/github.com/google/go-github/v38/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users.go rename to vendor/github.com/google/go-github/v38/github/users.go diff --git a/vendor/github.com/google/go-github/v37/github/users_administration.go b/vendor/github.com/google/go-github/v38/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_administration.go rename to vendor/github.com/google/go-github/v38/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v37/github/users_blocking.go b/vendor/github.com/google/go-github/v38/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_blocking.go rename to vendor/github.com/google/go-github/v38/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v37/github/users_emails.go b/vendor/github.com/google/go-github/v38/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_emails.go rename to vendor/github.com/google/go-github/v38/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v37/github/users_followers.go b/vendor/github.com/google/go-github/v38/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_followers.go rename to vendor/github.com/google/go-github/v38/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v37/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v38/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v38/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v37/github/users_keys.go b/vendor/github.com/google/go-github/v38/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_keys.go rename to vendor/github.com/google/go-github/v38/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v37/github/users_projects.go b/vendor/github.com/google/go-github/v38/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/users_projects.go rename to vendor/github.com/google/go-github/v38/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v37/github/with_appengine.go b/vendor/github.com/google/go-github/v38/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/with_appengine.go rename to vendor/github.com/google/go-github/v38/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v37/github/without_appengine.go b/vendor/github.com/google/go-github/v38/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v37/github/without_appengine.go rename to vendor/github.com/google/go-github/v38/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index d576df6b42..5702df70b5 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/v37 v37.0.0 +# github.com/google/go-github/v38 v38.1.0 ## explicit -github.com/google/go-github/v37/github +github.com/google/go-github/v38/github # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/google/uuid v1.1.1