From 02d3b3738d6921fe531d31a97350cf354ff732a3 Mon Sep 17 00:00:00 2001 From: Keegan Campbell Date: Thu, 13 Jan 2022 16:01:36 -0800 Subject: [PATCH] Bump go-github to v42; unblocks #1006 (#1035) --- github/config.go | 2 +- 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 +- github/data_source_github_repository_file.go | 2 +- ..._source_github_repository_pull_requests.go | 2 +- github/data_source_github_team.go | 2 +- github/repository_utils.go | 2 +- ...ource_github_actions_environment_secret.go | 2 +- ...github_actions_organization_permissions.go | 2 +- ...urce_github_actions_organization_secret.go | 2 +- ...ctions_organization_secret_repositories.go | 2 +- .../resource_github_actions_runner_group.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 +- ...ce_github_repository_autolink_reference.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 | 2 +- .../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 | 2 +- ...resource_github_team_sync_group_mapping.go | 2 +- ...rce_github_team_sync_group_mapping_test.go | 2 +- 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 | 9 +- .../google/go-github/{v41 => v42}/AUTHORS | 0 .../google/go-github/{v41 => v42}/LICENSE | 0 .../go-github/{v41 => v42}/github/actions.go | 0 .../{v41 => v42}/github/actions_artifacts.go | 0 .../github/actions_runner_groups.go | 0 .../{v41 => v42}/github/actions_runners.go | 0 .../{v41 => v42}/github/actions_secrets.go | 341 ++++----- .../github/actions_workflow_jobs.go | 0 .../github/actions_workflow_runs.go | 57 +- .../{v41 => v42}/github/actions_workflows.go | 0 .../go-github/{v41 => v42}/github/activity.go | 0 .../{v41 => v42}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{v41 => v42}/github/activity_star.go | 0 .../{v41 => v42}/github/activity_watching.go | 0 .../go-github/{v41 => v42}/github/admin.go | 0 .../{v41 => v42}/github/admin_orgs.go | 0 .../{v41 => v42}/github/admin_stats.go | 0 .../{v41 => v42}/github/admin_users.go | 0 .../go-github/{v41 => v42}/github/apps.go | 0 .../{v41 => v42}/github/apps_hooks.go | 0 .../v42/github/apps_hooks_deliveries.go | 72 ++ .../{v41 => v42}/github/apps_installation.go | 0 .../{v41 => v42}/github/apps_manifest.go | 0 .../{v41 => v42}/github/apps_marketplace.go | 0 .../{v41 => v42}/github/authorizations.go | 0 .../go-github/{v41 => v42}/github/billing.go | 0 .../go-github/{v41 => v42}/github/checks.go | 1 + .../{v41 => v42}/github/code-scanning.go | 85 +++ .../google/go-github/v42/github/dependabot.go | 12 + .../v42/github/dependabot_secrets.go | 228 ++++++ .../go-github/{v41 => v42}/github/doc.go | 8 +- .../{v41 => v42}/github/enterprise.go | 0 .../github/enterprise_actions_runners.go | 0 .../github/enterprise_audit_log.go | 0 .../go-github/{v41 => v42}/github/event.go | 2 + .../{v41 => v42}/github/event_types.go | 82 ++- .../go-github/{v41 => v42}/github/gists.go | 0 .../{v41 => v42}/github/gists_comments.go | 0 .../go-github/{v41 => v42}/github/git.go | 0 .../{v41 => v42}/github/git_blobs.go | 0 .../{v41 => v42}/github/git_commits.go | 0 .../go-github/{v41 => v42}/github/git_refs.go | 0 .../go-github/{v41 => v42}/github/git_tags.go | 0 .../{v41 => v42}/github/git_trees.go | 0 .../{v41 => v42}/github/github-accessors.go | 652 +++++++++++++++++- .../go-github/{v41 => v42}/github/github.go | 10 +- .../{v41 => v42}/github/gitignore.go | 0 .../{v41 => v42}/github/interactions.go | 0 .../{v41 => v42}/github/interactions_orgs.go | 0 .../{v41 => v42}/github/interactions_repos.go | 0 .../{v41 => v42}/github/issue_import.go | 0 .../go-github/{v41 => v42}/github/issues.go | 0 .../{v41 => v42}/github/issues_assignees.go | 0 .../{v41 => v42}/github/issues_comments.go | 0 .../{v41 => v42}/github/issues_events.go | 0 .../{v41 => v42}/github/issues_labels.go | 0 .../{v41 => v42}/github/issues_milestones.go | 0 .../{v41 => v42}/github/issues_timeline.go | 0 .../go-github/{v41 => v42}/github/licenses.go | 0 .../go-github/{v41 => v42}/github/messages.go | 5 +- .../{v41 => v42}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v41 => v42}/github/migrations_user.go | 0 .../go-github/{v41 => v42}/github/misc.go | 0 .../go-github/{v41 => v42}/github/orgs.go | 0 .../github/orgs_actions_allowed.go | 0 .../github/orgs_actions_permissions.go | 0 .../{v41 => v42}/github/orgs_audit_log.go | 0 .../{v41 => v42}/github/orgs_hooks.go | 0 .../github/orgs_hooks_deliveries.go | 0 .../{v41 => v42}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v41 => v42}/github/orgs_packages.go | 0 .../{v41 => v42}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v41 => v42}/github/packages.go | 0 .../go-github/{v41 => v42}/github/projects.go | 28 +- .../go-github/{v41 => v42}/github/pulls.go | 5 +- .../{v41 => v42}/github/pulls_comments.go | 0 .../{v41 => v42}/github/pulls_reviewers.go | 0 .../{v41 => v42}/github/pulls_reviews.go | 0 .../{v41 => v42}/github/reactions.go | 0 .../go-github/{v41 => v42}/github/repos.go | 21 + .../{v41 => v42}/github/repos_autolinks.go | 0 .../github/repos_collaborators.go | 0 .../{v41 => v42}/github/repos_comments.go | 0 .../{v41 => v42}/github/repos_commits.go | 0 .../github/repos_community_health.go | 0 .../{v41 => v42}/github/repos_contents.go | 0 .../{v41 => v42}/github/repos_deployments.go | 0 .../{v41 => v42}/github/repos_environments.go | 0 .../{v41 => v42}/github/repos_forks.go | 0 .../{v41 => v42}/github/repos_hooks.go | 0 .../github/repos_hooks_deliveries.go | 22 +- .../{v41 => v42}/github/repos_invitations.go | 0 .../{v41 => v42}/github/repos_keys.go | 0 .../{v41 => v42}/github/repos_merging.go | 0 .../{v41 => v42}/github/repos_pages.go | 24 +- .../github/repos_prereceive_hooks.go | 0 .../{v41 => v42}/github/repos_projects.go | 0 .../{v41 => v42}/github/repos_releases.go | 0 .../{v41 => v42}/github/repos_stats.go | 0 .../{v41 => v42}/github/repos_statuses.go | 0 .../{v41 => v42}/github/repos_traffic.go | 0 .../go-github/{v41 => v42}/github/scim.go | 0 .../go-github/{v41 => v42}/github/search.go | 0 .../go-github/{v41 => v42}/github/strings.go | 0 .../go-github/{v41 => v42}/github/teams.go | 114 +++ .../github/teams_discussion_comments.go | 0 .../{v41 => v42}/github/teams_discussions.go | 0 .../{v41 => v42}/github/teams_members.go | 0 .../{v41 => v42}/github/timestamp.go | 0 .../go-github/{v41 => v42}/github/users.go | 0 .../github/users_administration.go | 0 .../{v41 => v42}/github/users_blocking.go | 0 .../{v41 => v42}/github/users_emails.go | 0 .../{v41 => v42}/github/users_followers.go | 0 .../{v41 => v42}/github/users_gpg_keys.go | 0 .../{v41 => v42}/github/users_keys.go | 0 .../{v41 => v42}/github/users_packages.go | 6 +- .../{v41 => v42}/github/users_projects.go | 0 .../{v41 => v42}/github/with_appengine.go | 0 .../{v41 => v42}/github/without_appengine.go | 0 vendor/modules.txt | 4 +- 180 files changed, 1553 insertions(+), 343 deletions(-) rename vendor/github.com/google/go-github/{v41 => v42}/AUTHORS (100%) rename vendor/github.com/google/go-github/{v41 => v42}/LICENSE (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_artifacts.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_runner_groups.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_runners.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_secrets.go (72%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_workflow_jobs.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_workflow_runs.go (80%) rename vendor/github.com/google/go-github/{v41 => v42}/github/actions_workflows.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/admin.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/admin_orgs.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/admin_stats.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/admin_users.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/apps.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/apps_hooks.go (100%) create mode 100644 vendor/github.com/google/go-github/v42/github/apps_hooks_deliveries.go rename vendor/github.com/google/go-github/{v41 => v42}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/apps_manifest.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/authorizations.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/billing.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/checks.go (99%) rename vendor/github.com/google/go-github/{v41 => v42}/github/code-scanning.go (70%) create mode 100644 vendor/github.com/google/go-github/v42/github/dependabot.go create mode 100644 vendor/github.com/google/go-github/v42/github/dependabot_secrets.go rename vendor/github.com/google/go-github/{v41 => v42}/github/doc.go (96%) rename vendor/github.com/google/go-github/{v41 => v42}/github/enterprise.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/enterprise_actions_runners.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/enterprise_audit_log.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/event.go (98%) rename vendor/github.com/google/go-github/{v41 => v42}/github/event_types.go (93%) rename vendor/github.com/google/go-github/{v41 => v42}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/git.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/git_commits.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/github-accessors.go (96%) rename vendor/github.com/google/go-github/{v41 => v42}/github/github.go (99%) rename vendor/github.com/google/go-github/{v41 => v42}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issue_import.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues_labels.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/messages.go (97%) rename vendor/github.com/google/go-github/{v41 => v42}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/misc.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_actions_permissions.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_audit_log.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_members.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_packages.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/packages.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/projects.go (95%) rename vendor/github.com/google/go-github/{v41 => v42}/github/pulls.go (98%) rename vendor/github.com/google/go-github/{v41 => v42}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos.go (99%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_autolinks.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_commits.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_contents.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_deployments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_environments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_hooks.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_hooks_deliveries.go (84%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_pages.go (86%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_prereceive_hooks.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/scim.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/search.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/strings.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/teams.go (88%) rename vendor/github.com/google/go-github/{v41 => v42}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_administration.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_packages.go (97%) rename vendor/github.com/google/go-github/{v41 => v42}/github/users_projects.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v41 => v42}/github/without_appengine.go (100%) diff --git a/github/config.go b/github/config.go index 2d13995e36..6b53179a40 100644 --- a/github/config.go +++ b/github/config.go @@ -8,7 +8,7 @@ import ( "path" "time" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" diff --git a/github/data_source_github_branch.go b/github/data_source_github_branch.go index c9a2c2f301..ea1772df8d 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/v41/github" + "github.com/google/go-github/v42/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 ee266f6825..5877f50764 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/v41/github" + "github.com/google/go-github/v42/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 130428f57c..5208f78e4c 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/v41/github" + "github.com/google/go-github/v42/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 824064ea1a..c7668c9f0b 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/v41/github" + "github.com/google/go-github/v42/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 7d1c90a22f..08f790b3ea 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/v41/github" + "github.com/google/go-github/v42/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 578fe5af47..af9fe77b56 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/v41/github" + "github.com/google/go-github/v42/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_file.go b/github/data_source_github_repository_file.go index e6d971b7cf..79da02c757 100644 --- a/github/data_source_github_repository_file.go +++ b/github/data_source_github_repository_file.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index b010cf479e..0e929390b9 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/v41/github" + "github.com/google/go-github/v42/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 d85da3e20c..7bd0e01a0e 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/repository_utils.go b/github/repository_utils.go index fb9f0198f1..2940005b0b 100644 --- a/github/repository_utils.go +++ b/github/repository_utils.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" ) // checkRepositoryBranchExists tests if a branch exists in a repository. diff --git a/github/resource_github_actions_environment_secret.go b/github/resource_github_actions_environment_secret.go index 4dd4c82b19..431105df78 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_organization_permissions.go b/github/resource_github_actions_organization_permissions.go index cdcbd2a253..c48a51f866 100644 --- a/github/resource_github_actions_organization_permissions.go +++ b/github/resource_github_actions_organization_permissions.go @@ -5,7 +5,7 @@ import ( "errors" "log" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/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 366c72741e..9bf66fa38d 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret_repositories.go b/github/resource_github_actions_organization_secret_repositories.go index 533e7234b8..01006213a3 100644 --- a/github/resource_github_actions_organization_secret_repositories.go +++ b/github/resource_github_actions_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_actions_runner_group.go b/github/resource_github_actions_runner_group.go index a44cf613ea..e7ef70f603 100644 --- a/github/resource_github_actions_runner_group.go +++ b/github/resource_github_actions_runner_group.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/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 804302d17f..8fbb5c0dbb 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/v41/github" + "github.com/google/go-github/v42/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 4c4ebfa00c..bdb4273e27 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 822fe290c1..a8afccb744 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/v41/github" + "github.com/google/go-github/v42/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 c44828b811..ee9a285b4d 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/v41/github" + "github.com/google/go-github/v42/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 c2017bcb24..8acb248ce5 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/v41/github" + "github.com/google/go-github/v42/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 c463476f60..601f55c12e 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/v41/github" + "github.com/google/go-github/v42/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 262826852a..672192a87d 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index c1cbe06744..68d0adaf9d 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/v41/github" + "github.com/google/go-github/v42/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 ede04e1126..5c20e67dc3 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/v41/github" + "github.com/google/go-github/v42/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 61d07ffbb1..d66611f54a 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/v41/github" + "github.com/google/go-github/v42/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 4ee40b3cc0..a1d6aa83b8 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/v41/github" + "github.com/google/go-github/v42/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 d24d0eca37..c9f1661be4 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/v41/github" + "github.com/google/go-github/v42/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 10473999bd..14056d6b0a 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/v41/github" + "github.com/google/go-github/v42/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 f7932551fb..c4c28218d4 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/v41/github" + "github.com/google/go-github/v42/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 7d55e76ab5..ba489e8946 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/v41/github" + "github.com/google/go-github/v42/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 b63f5c3e63..a7156c5566 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) diff --git a/github/resource_github_repository_autolink_reference.go b/github/resource_github_repository_autolink_reference.go index 833951d519..32084abb6a 100644 --- a/github/resource_github_repository_autolink_reference.go +++ b/github/resource_github_repository_autolink_reference.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/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 848a0f6be1..047f385ac9 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/v41/github" + "github.com/google/go-github/v42/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 09c48e5d2a..e456f5e209 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/v41/github" + "github.com/google/go-github/v42/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 ab13a4600d..936fedfe7d 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/v41/github" + "github.com/google/go-github/v42/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 5bd065cdfc..de3fa557ad 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -7,7 +7,7 @@ import ( "fmt" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index 822176cb3f..a34aa9adca 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/v41/github" + "github.com/google/go-github/v42/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 a239fbe2b8..bfbf8d2392 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/v41/github" + "github.com/google/go-github/v42/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 84e9773223..0fce420615 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/v41/github" + "github.com/google/go-github/v42/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 7f86c48a05..4562f3b457 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 78b7b9d004..b8d2e6628f 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/v41/github" + "github.com/google/go-github/v42/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 f7bbdcf746..6014414e48 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/v41/github" + "github.com/google/go-github/v42/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 b80aa03a47..c203c9e3f2 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/v41/github" + "github.com/google/go-github/v42/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 0fcd354023..542c3c5b3c 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping.go b/github/resource_github_team_sync_group_mapping.go index 351935ab6e..35f98fd665 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/v41/github" + "github.com/google/go-github/v42/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 12b0bc3de0..57cbb23d4a 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index fcffcb47ea..eb44ab5931 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/v41/github" + "github.com/google/go-github/v42/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 901970b6df..15e3f1d351 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index 947927b14a..1f709c6b61 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/v41/github" + "github.com/google/go-github/v42/github" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 01ff46e93e..eb042e33dd 100644 --- a/github/transport.go +++ b/github/transport.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index 96f8fdb052..f1d8135159 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -10,7 +10,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util_permissions.go b/github/util_permissions.go index 62eafa561c..3f55d627f8 100644 --- a/github/util_permissions.go +++ b/github/util_permissions.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/google/go-github/v41/github" + "github.com/google/go-github/v42/github" ) const ( diff --git a/go.mod b/go.mod index ccf4a17c02..f19367bf10 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/v41 v41.0.0 + github.com/google/go-github/v42 v42.0.0 github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 // indirect github.com/hashicorp/hcl/v2 v2.3.0 // indirect github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7 // indirect diff --git a/go.sum b/go.sum index 3c606b8f48..7c2fc664eb 100644 --- a/go.sum +++ b/go.sum @@ -42,6 +42,7 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bombsimon/wsl/v3 v3.0.0 h1:w9f49xQatuaeTJFaNP4SpiWSR5vfT6IstPtM62JjcqA= github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= +github.com/bradleyfalzon/ghinstallation/v2 v2.0.3/go.mod h1:tlgi+JWCXnKFx/Y4WtnDbZEINo31N5bcvnCoqieefmk= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= @@ -106,6 +107,7 @@ github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQq github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -157,8 +159,11 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= -github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= +github.com/google/go-github/v39 v39.0.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= +github.com/google/go-github/v42 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= +github.com/google/go-github/v42 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= +github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5PxwaoLec= +github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= diff --git a/vendor/github.com/google/go-github/v41/AUTHORS b/vendor/github.com/google/go-github/v42/AUTHORS similarity index 100% rename from vendor/github.com/google/go-github/v41/AUTHORS rename to vendor/github.com/google/go-github/v42/AUTHORS diff --git a/vendor/github.com/google/go-github/v41/LICENSE b/vendor/github.com/google/go-github/v42/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v41/LICENSE rename to vendor/github.com/google/go-github/v42/LICENSE diff --git a/vendor/github.com/google/go-github/v41/github/actions.go b/vendor/github.com/google/go-github/v42/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/actions.go rename to vendor/github.com/google/go-github/v42/github/actions.go diff --git a/vendor/github.com/google/go-github/v41/github/actions_artifacts.go b/vendor/github.com/google/go-github/v42/github/actions_artifacts.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v42/github/actions_artifacts.go diff --git a/vendor/github.com/google/go-github/v41/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v42/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v42/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v41/github/actions_runners.go b/vendor/github.com/google/go-github/v42/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/actions_runners.go rename to vendor/github.com/google/go-github/v42/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v41/github/actions_secrets.go b/vendor/github.com/google/go-github/v42/github/actions_secrets.go similarity index 72% rename from vendor/github.com/google/go-github/v41/github/actions_secrets.go rename to vendor/github.com/google/go-github/v42/github/actions_secrets.go index 5bfb22ac08..29f70a1a16 100644 --- a/vendor/github.com/google/go-github/v41/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v42/github/actions_secrets.go @@ -47,12 +47,8 @@ func (p *PublicKey) UnmarshalJSON(data []byte) error { return nil } -// GetRepoPublicKey gets a public key that should be used for secret encryption. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-repository-public-key -func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) - req, err := s.client.NewRequest("GET", u, nil) +func (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) if err != nil { return nil, nil, err } @@ -66,42 +62,28 @@ func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo strin return pubKey, resp, nil } +// GetRepoPublicKey gets a public key that should be used for secret encryption. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-repository-public-key +func (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/secrets/public-key", owner, repo) + return s.getPublicKey(ctx, url) +} + // GetOrgPublicKey gets a public key that should be used for secret encryption. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-an-organization-public-key func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - pubKey := new(PublicKey) - resp, err := s.client.Do(ctx, req, pubKey) - if err != nil { - return nil, resp, err - } - - return pubKey, resp, nil + url := fmt.Sprintf("orgs/%v/actions/secrets/public-key", org) + return s.getPublicKey(ctx, url) } // GetEnvPublicKey gets a public key that should be used for secret encryption. // // GitHub API docs: https://docs.github.com/en/rest/reference/actions#get-an-environment-public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { - u := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - pubKey := new(PublicKey) - resp, err := s.client.Do(ctx, req, pubKey) - if err != nil { - return nil, resp, err - } - - return pubKey, resp, nil + url := fmt.Sprintf("repositories/%v/environments/%v/secrets/public-key", repoID, env) + return s.getPublicKey(ctx, url) } // Secret represents a repository action secret. @@ -119,13 +101,8 @@ type Secrets struct { Secrets []*Secret `json:"secrets"` } -// ListRepoSecrets lists all secrets available in a repository -// without revealing their encrypted values. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-repository-secrets -func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) - u, err := addOptions(u, opts) +func (s *ActionsService) listSecrets(ctx context.Context, url string, opts *ListOptions) (*Secrets, *Response, error) { + u, err := addOptions(url, opts) if err != nil { return nil, nil, err } @@ -144,12 +121,34 @@ func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string return secrets, resp, nil } -// GetRepoSecret gets a single repository secret without revealing its encrypted value. +// ListRepoSecrets lists all secrets available in a repository +// without revealing their encrypted values. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-repository-secret -func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) - req, err := s.client.NewRequest("GET", u, nil) +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-repository-secrets +func (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/secrets", owner, repo) + return s.listSecrets(ctx, url, opts) +} + +// ListOrgSecrets lists all secrets available in an organization +// without revealing their encrypted values. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-organization-secrets +func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets", org) + return s.listSecrets(ctx, url, opts) +} + +// ListEnvSecrets lists all secrets available in an environment. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-environment-secrets +func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) + return s.listSecrets(ctx, url, opts) +} + +func (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) if err != nil { return nil, nil, err } @@ -163,6 +162,30 @@ func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name st return secret, resp, nil } +// GetRepoSecret gets a single repository secret without revealing its encrypted value. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-a-repository-secret +func (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) + return s.getSecret(ctx, url) +} + +// GetOrgSecret gets a single organization secret without revealing its encrypted value. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-an-organization-secret +func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) + return s.getSecret(ctx, url) +} + +// GetEnvSecret gets a single environment secret without revealing its encrypted value. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-environment-secrets +func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) + return s.getSecret(ctx, url) +} + // SelectedRepoIDs are the repository IDs that have access to the secret. type SelectedRepoIDs []int64 @@ -179,13 +202,8 @@ type EncryptedSecret struct { SelectedRepositoryIDs SelectedRepoIDs `json:"selected_repository_ids,omitempty"` } -// CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-or-update-a-repository-secret -func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) - - req, err := s.client.NewRequest("PUT", u, eSecret) +func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, eSecret) if err != nil { return nil, err } @@ -193,76 +211,61 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re return s.client.Do(ctx, req, nil) } -// DeleteRepoSecret deletes a secret in a repository using the secret name. +// CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-a-repository-secret -func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-or-update-a-repository-secret +func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) + return s.putSecret(ctx, url, eSecret) } -// ListOrgSecrets lists all secrets available in an organization -// without revealing their encrypted values. +// CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-organization-secrets -func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets", org) - 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 - } - - secrets := new(Secrets) - resp, err := s.client.Do(ctx, req, &secrets) - if err != nil { - return nil, resp, err - } - - return secrets, resp, nil +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-or-update-an-organization-secret +func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) + return s.putSecret(ctx, url, eSecret) } -// GetOrgSecret gets a single organization secret without revealing its encrypted value. +// CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#get-an-organization-secret -func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#create-or-update-an-environment-secret +func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) + return s.putSecret(ctx, url, eSecret) +} - secret := new(Secret) - resp, err := s.client.Do(ctx, req, secret) +func (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, nil) if err != nil { - return nil, resp, err + return nil, err } - return secret, resp, nil + return s.client.Do(ctx, req, nil) } -// CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value. +// DeleteRepoSecret deletes a secret in a repository using the secret name. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#create-or-update-an-organization-secret -func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-a-repository-secret +func (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, name) + return s.deleteSecret(ctx, url) +} - req, err := s.client.NewRequest("PUT", u, eSecret) - if err != nil { - return nil, err - } +// DeleteOrgSecret deletes a secret in an organization using the secret name. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-an-organization-secret +func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) + return s.deleteSecret(ctx, url) +} - return s.client.Do(ctx, req, nil) +// DeleteEnvSecret deletes a secret in an environment using the secret name. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-an-environment-secret +func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { + url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) + return s.deleteSecret(ctx, url) } // SelectedReposList represents the list of repositories selected for an organization secret. @@ -271,12 +274,8 @@ type SelectedReposList struct { Repositories []*Repository `json:"repositories,omitempty"` } -// ListSelectedReposForOrgSecret lists all repositories that have access to a secret. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-selected-repositories-for-an-organization-secret -func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) - u, err := addOptions(u, opts) +func (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url string, opts *ListOptions) (*SelectedReposList, *Response, error) { + u, err := addOptions(url, opts) if err != nil { return nil, nil, err } @@ -295,17 +294,20 @@ func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, return result, resp, nil } -// SetSelectedReposForOrgSecret sets the repositories that have access to a secret. +// ListSelectedReposForOrgSecret lists all repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#set-selected-repositories-for-an-organization-secret -func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#list-selected-repositories-for-an-organization-secret +func (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) + return s.listSelectedReposForSecret(ctx, url, opts) +} +func (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url string, ids SelectedRepoIDs) (*Response, error) { type repoIDs struct { SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` } - req, err := s.client.NewRequest("PUT", u, repoIDs{SelectedIDs: ids}) + req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) if err != nil { return nil, err } @@ -313,39 +315,16 @@ func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, return s.client.Do(ctx, req, nil) } -// AddSelectedRepoToOrgSecret adds a repository to an organization secret. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#add-selected-repository-to-an-organization-secret -func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) - req, err := s.client.NewRequest("PUT", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. +// SetSelectedReposForOrgSecret sets the repositories that have access to a secret. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#remove-selected-repository-from-an-organization-secret -func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#set-selected-repositories-for-an-organization-secret +func (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories", org, name) + return s.setSelectedReposForSecret(ctx, url, ids) } -// DeleteOrgSecret deletes a secret in an organization using the secret name. -// -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-an-organization-secret -func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, name) - - req, err := s.client.NewRequest("DELETE", u, nil) +func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, nil) if err != nil { return nil, err } @@ -353,56 +332,16 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) return s.client.Do(ctx, req, nil) } -// ListEnvSecrets lists all secrets available in an environment. -// -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-environment-secrets -func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { - u := fmt.Sprintf("repositories/%v/environments/%v/secrets", repoID, env) - 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 - } - - secrets := new(Secrets) - resp, err := s.client.Do(ctx, req, &secrets) - if err != nil { - return nil, resp, err - } - - return secrets, resp, nil -} - -// GetEnvSecret gets a single environment secret without revealing its encrypted value. +// AddSelectedRepoToOrgSecret adds a repository to an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#list-environment-secrets -func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { - u := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - secret := new(Secret) - resp, err := s.client.Do(ctx, req, secret) - if err != nil { - return nil, resp, err - } - - return secret, resp, nil +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#add-selected-repository-to-an-organization-secret +func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) + return s.addSelectedRepoToSecret(ctx, url) } -// CreateOrUpdateEnvSecret creates or updates a repository secret with an encrypted value. -// -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#create-or-update-an-environment-secret -func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { - u := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) - - req, err := s.client.NewRequest("PUT", u, eSecret) +func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, nil) if err != nil { return nil, err } @@ -410,16 +349,10 @@ func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int return s.client.Do(ctx, req, nil) } -// DeleteEnvSecret deletes a secret in an environment using the secret name. +// RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret. // -// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-an-environment-secret -func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { - u := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, secretName) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#remove-selected-repository-from-an-organization-secret +func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) + return s.removeSelectedRepoFromSecret(ctx, url) } diff --git a/vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v42/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v42/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v42/github/actions_workflow_runs.go similarity index 80% rename from vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v42/github/actions_workflow_runs.go index 2c90956c26..1e1ff61ae8 100644 --- a/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v42/github/actions_workflow_runs.go @@ -14,33 +14,36 @@ import ( // WorkflowRun represents a repository action workflow run. type WorkflowRun struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - NodeID *string `json:"node_id,omitempty"` - HeadBranch *string `json:"head_branch,omitempty"` - HeadSHA *string `json:"head_sha,omitempty"` - RunNumber *int `json:"run_number,omitempty"` - Event *string `json:"event,omitempty"` - Status *string `json:"status,omitempty"` - Conclusion *string `json:"conclusion,omitempty"` - WorkflowID *int64 `json:"workflow_id,omitempty"` - CheckSuiteID *int64 `json:"check_suite_id,omitempty"` - CheckSuiteNodeID *string `json:"check_suite_node_id,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - PullRequests []*PullRequest `json:"pull_requests,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - JobsURL *string `json:"jobs_url,omitempty"` - LogsURL *string `json:"logs_url,omitempty"` - CheckSuiteURL *string `json:"check_suite_url,omitempty"` - ArtifactsURL *string `json:"artifacts_url,omitempty"` - CancelURL *string `json:"cancel_url,omitempty"` - RerunURL *string `json:"rerun_url,omitempty"` - HeadCommit *HeadCommit `json:"head_commit,omitempty"` - WorkflowURL *string `json:"workflow_url,omitempty"` - Repository *Repository `json:"repository,omitempty"` - HeadRepository *Repository `json:"head_repository,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + NodeID *string `json:"node_id,omitempty"` + HeadBranch *string `json:"head_branch,omitempty"` + HeadSHA *string `json:"head_sha,omitempty"` + RunNumber *int `json:"run_number,omitempty"` + RunAttempt *int `json:"run_attempt,omitempty"` + Event *string `json:"event,omitempty"` + Status *string `json:"status,omitempty"` + Conclusion *string `json:"conclusion,omitempty"` + WorkflowID *int64 `json:"workflow_id,omitempty"` + CheckSuiteID *int64 `json:"check_suite_id,omitempty"` + CheckSuiteNodeID *string `json:"check_suite_node_id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + PullRequests []*PullRequest `json:"pull_requests,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + RunStartedAt *Timestamp `json:"run_started_at,omitempty"` + JobsURL *string `json:"jobs_url,omitempty"` + LogsURL *string `json:"logs_url,omitempty"` + CheckSuiteURL *string `json:"check_suite_url,omitempty"` + ArtifactsURL *string `json:"artifacts_url,omitempty"` + CancelURL *string `json:"cancel_url,omitempty"` + RerunURL *string `json:"rerun_url,omitempty"` + PreviousAttemptURL *string `json:"previous_attempt_url,omitempty"` + HeadCommit *HeadCommit `json:"head_commit,omitempty"` + WorkflowURL *string `json:"workflow_url,omitempty"` + Repository *Repository `json:"repository,omitempty"` + HeadRepository *Repository `json:"head_repository,omitempty"` } // WorkflowRuns represents a slice of repository action workflow run. diff --git a/vendor/github.com/google/go-github/v41/github/actions_workflows.go b/vendor/github.com/google/go-github/v42/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/actions_workflows.go rename to vendor/github.com/google/go-github/v42/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v41/github/activity.go b/vendor/github.com/google/go-github/v42/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/activity.go rename to vendor/github.com/google/go-github/v42/github/activity.go diff --git a/vendor/github.com/google/go-github/v41/github/activity_events.go b/vendor/github.com/google/go-github/v42/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/activity_events.go rename to vendor/github.com/google/go-github/v42/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v41/github/activity_notifications.go b/vendor/github.com/google/go-github/v42/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/activity_notifications.go rename to vendor/github.com/google/go-github/v42/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v41/github/activity_star.go b/vendor/github.com/google/go-github/v42/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/activity_star.go rename to vendor/github.com/google/go-github/v42/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v41/github/activity_watching.go b/vendor/github.com/google/go-github/v42/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/activity_watching.go rename to vendor/github.com/google/go-github/v42/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v41/github/admin.go b/vendor/github.com/google/go-github/v42/github/admin.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/admin.go rename to vendor/github.com/google/go-github/v42/github/admin.go diff --git a/vendor/github.com/google/go-github/v41/github/admin_orgs.go b/vendor/github.com/google/go-github/v42/github/admin_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/admin_orgs.go rename to vendor/github.com/google/go-github/v42/github/admin_orgs.go diff --git a/vendor/github.com/google/go-github/v41/github/admin_stats.go b/vendor/github.com/google/go-github/v42/github/admin_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/admin_stats.go rename to vendor/github.com/google/go-github/v42/github/admin_stats.go diff --git a/vendor/github.com/google/go-github/v41/github/admin_users.go b/vendor/github.com/google/go-github/v42/github/admin_users.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/admin_users.go rename to vendor/github.com/google/go-github/v42/github/admin_users.go diff --git a/vendor/github.com/google/go-github/v41/github/apps.go b/vendor/github.com/google/go-github/v42/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/apps.go rename to vendor/github.com/google/go-github/v42/github/apps.go diff --git a/vendor/github.com/google/go-github/v41/github/apps_hooks.go b/vendor/github.com/google/go-github/v42/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/apps_hooks.go rename to vendor/github.com/google/go-github/v42/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v42/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v42/github/apps_hooks_deliveries.go new file mode 100644 index 0000000000..0b631b80e8 --- /dev/null +++ b/vendor/github.com/google/go-github/v42/github/apps_hooks_deliveries.go @@ -0,0 +1,72 @@ +// 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 deliveries of an App webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/apps#list-deliveries-for-an-app-webhook +func (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) { + u, err := addOptions("app/hook/deliveries", 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 the App webhook delivery with the specified ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/apps#get-a-delivery-for-an-app-webhook +func (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { + u := fmt.Sprintf("app/hook/deliveries/%v", 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 +} + +// RedeliverHookDelivery redelivers a delivery for an App webhook. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/apps#redeliver-a-delivery-for-an-app-webhook +func (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) { + u := fmt.Sprintf("app/hook/deliveries/%v/attempts", deliveryID) + req, err := s.client.NewRequest("POST", 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/v41/github/apps_installation.go b/vendor/github.com/google/go-github/v42/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/apps_installation.go rename to vendor/github.com/google/go-github/v42/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v41/github/apps_manifest.go b/vendor/github.com/google/go-github/v42/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/apps_manifest.go rename to vendor/github.com/google/go-github/v42/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v41/github/apps_marketplace.go b/vendor/github.com/google/go-github/v42/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v42/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v41/github/authorizations.go b/vendor/github.com/google/go-github/v42/github/authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/authorizations.go rename to vendor/github.com/google/go-github/v42/github/authorizations.go diff --git a/vendor/github.com/google/go-github/v41/github/billing.go b/vendor/github.com/google/go-github/v42/github/billing.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/billing.go rename to vendor/github.com/google/go-github/v42/github/billing.go diff --git a/vendor/github.com/google/go-github/v41/github/checks.go b/vendor/github.com/google/go-github/v42/github/checks.go similarity index 99% rename from vendor/github.com/google/go-github/v41/github/checks.go rename to vendor/github.com/google/go-github/v42/github/checks.go index 07afb7c439..253d351896 100644 --- a/vendor/github.com/google/go-github/v41/github/checks.go +++ b/vendor/github.com/google/go-github/v42/github/checks.go @@ -234,6 +234,7 @@ type ListCheckRunsOptions struct { CheckName *string `url:"check_name,omitempty"` // Returns check runs with the specified name. Status *string `url:"status,omitempty"` // Returns check runs with the specified status. Can be one of "queued", "in_progress", or "completed". Filter *string `url:"filter,omitempty"` // Filters check runs by their completed_at timestamp. Can be one of "latest" (returning the most recent check runs) or "all". Default: "latest" + AppID *int64 `url:"app_id,omitempty"` // Filters check runs by GitHub App ID. ListOptions } diff --git a/vendor/github.com/google/go-github/v41/github/code-scanning.go b/vendor/github.com/google/go-github/v42/github/code-scanning.go similarity index 70% rename from vendor/github.com/google/go-github/v41/github/code-scanning.go rename to vendor/github.com/google/go-github/v42/github/code-scanning.go index 4508c3390d..9616f3a26d 100644 --- a/vendor/github.com/google/go-github/v41/github/code-scanning.go +++ b/vendor/github.com/google/go-github/v42/github/code-scanning.go @@ -119,6 +119,38 @@ type AlertListOptions struct { ListOptions } +// AnalysesListOptions specifies optional parameters to the CodeScanningService.ListAnalysesForRepo method. +type AnalysesListOptions struct { + // Return code scanning analyses belonging to the same SARIF upload. + SarifID *string `url:"sarif_id,omitempty"` + + // Return code scanning analyses for a specific branch reference. The ref can be formatted as refs/heads/ or simply . + Ref *string `url:"ref,omitempty"` + + ListOptions +} + +// ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository +type ScanningAnalysis struct { + ID *int64 `json:"id,omitempty"` + Ref *string `json:"ref,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + AnalysisKey *string `json:"analysis_key,omitempty"` + Environment *string `json:"environment,omitempty"` + Error *string `json:"error,omitempty"` + Category *string `json:"category,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + ResultsCount *int `json:"results_count,omitempty"` + RulesCount *int `json:"rules_count,omitempty"` + URL *string `json:"url,omitempty"` + SarifID *string `json:"sarif_id,omitempty"` + Tool *Tool `json:"tool,omitempty"` + Deletable *bool `json:"deletable,omitempty"` + Warning *string `json:"warning,omitempty"` +} + // SarifAnalysis specifies the results of a code scanning job. // // GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data @@ -215,3 +247,56 @@ func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo strin return sarifID, resp, nil } + +// ListAnalysesForRepo lists code scanning analyses for a repository. +// +// Lists the details of all code scanning analyses for a repository, starting with the most recent. +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#list-code-scanning-analyses-for-a-repository +func (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses", owner, repo) + 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 + } + + var analyses []*ScanningAnalysis + resp, err := s.client.Do(ctx, req, &analyses) + if err != nil { + return nil, resp, err + } + + return analyses, resp, nil +} + +// GetAnalysis gets a single code scanning analysis for a repository. +// +// You must use an access token with the security_events scope to use this endpoint. +// GitHub Apps must have the security_events read permission to use this endpoint. +// +// The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#get-a-code-scanning-analysis-for-a-repository +func (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/analyses/%v", owner, repo, id) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + analysis := new(ScanningAnalysis) + resp, err := s.client.Do(ctx, req, analysis) + if err != nil { + return nil, resp, err + } + + return analysis, resp, nil +} diff --git a/vendor/github.com/google/go-github/v42/github/dependabot.go b/vendor/github.com/google/go-github/v42/github/dependabot.go new file mode 100644 index 0000000000..8ee0c0c7d8 --- /dev/null +++ b/vendor/github.com/google/go-github/v42/github/dependabot.go @@ -0,0 +1,12 @@ +// Copyright 2022 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +// DependabotService handles communication with the Dependabot related +// methods of the GitHub API. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/dependabot/ +type DependabotService service diff --git a/vendor/github.com/google/go-github/v42/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v42/github/dependabot_secrets.go new file mode 100644 index 0000000000..a6645339cc --- /dev/null +++ b/vendor/github.com/google/go-github/v42/github/dependabot_secrets.go @@ -0,0 +1,228 @@ +// Copyright 2022 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +func (s *DependabotService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + pubKey := new(PublicKey) + resp, err := s.client.Do(ctx, req, pubKey) + if err != nil { + return nil, resp, err + } + + return pubKey, resp, nil +} + +// GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-a-repository-public-key +func (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/public-key", owner, repo) + return s.getPublicKey(ctx, url) +} + +// GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-an-organization-public-key +func (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/public-key", org) + return s.getPublicKey(ctx, url) +} + +func (s *DependabotService) listSecrets(ctx context.Context, url string, opts *ListOptions) (*Secrets, *Response, error) { + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + secrets := new(Secrets) + resp, err := s.client.Do(ctx, req, &secrets) + if err != nil { + return nil, resp, err + } + + return secrets, resp, nil +} + +// ListRepoSecrets lists all Dependabot secrets available in a repository +// without revealing their encrypted values. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#list-repository-secrets +func (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/secrets", owner, repo) + return s.listSecrets(ctx, url, opts) +} + +// ListOrgSecrets lists all Dependabot secrets available in an organization +// without revealing their encrypted values. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#list-organization-secrets +func (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets", org) + return s.listSecrets(ctx, url, opts) +} + +func (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) { + req, err := s.client.NewRequest("GET", url, nil) + if err != nil { + return nil, nil, err + } + + secret := new(Secret) + resp, err := s.client.Do(ctx, req, secret) + if err != nil { + return nil, resp, err + } + + return secret, resp, nil +} + +// GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-a-repository-secret +func (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) + return s.getSecret(ctx, url) +} + +// GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#get-an-organization-secret +func (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) + return s.getSecret(ctx, url) +} + +func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) { + req, err := s.client.NewRequest("PUT", url, eSecret) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#create-or-update-a-repository-secret +func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) + return s.putSecret(ctx, url, eSecret) +} + +// CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#create-or-update-an-organization-secret +func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, eSecret.Name) + return s.putSecret(ctx, url, eSecret) +} + +func (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Response, error) { + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#delete-a-repository-secret +func (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, name) + return s.deleteSecret(ctx, url) +} + +// DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#delete-an-organization-secret +func (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v", org, name) + return s.deleteSecret(ctx, url) +} + +// ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#list-selected-repositories-for-an-organization-secret +func (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) + u, err := addOptions(url, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + result := new(SelectedReposList) + resp, err := s.client.Do(ctx, req, result) + if err != nil { + return nil, resp, err + } + + return result, resp, nil +} + +// SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#set-selected-repositories-for-an-organization-secret +func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories", org, name) + type repoIDs struct { + SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` + } + + req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#add-selected-repository-to-an-organization-secret +func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) + req, err := s.client.NewRequest("PUT", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/dependabot#remove-selected-repository-from-an-organization-secret +func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) + req, err := s.client.NewRequest("DELETE", url, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v41/github/doc.go b/vendor/github.com/google/go-github/v42/github/doc.go similarity index 96% rename from vendor/github.com/google/go-github/v41/github/doc.go rename to vendor/github.com/google/go-github/v42/github/doc.go index d67e286973..556d27c4bf 100644 --- a/vendor/github.com/google/go-github/v41/github/doc.go +++ b/vendor/github.com/google/go-github/v42/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v41/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v42/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 @@ -125,12 +125,16 @@ from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client. -To detect an API rate limit error, you can check if its type is *github.RateLimitError: +To detect an API rate limit error, you can check if its type is *github.RateLimitError. +For secondary rate limits, you can check if its type is *github.AbuseRateLimitError: repos, _, err := client.Repositories.List(ctx, "", nil) if _, ok := err.(*github.RateLimitError); ok { log.Println("hit rate limit") } + if _, ok := err.(*github.AbuseRateLimitError); ok { + log.Println("hit secondary rate limit") + } Learn more about GitHub rate limiting at https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting. diff --git a/vendor/github.com/google/go-github/v41/github/enterprise.go b/vendor/github.com/google/go-github/v42/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/enterprise.go rename to vendor/github.com/google/go-github/v42/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v41/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v42/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v42/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v41/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v42/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v42/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v41/github/event.go b/vendor/github.com/google/go-github/v42/github/event.go similarity index 98% rename from vendor/github.com/google/go-github/v41/github/event.go rename to vendor/github.com/google/go-github/v42/github/event.go index 9241d0286d..136abb273d 100644 --- a/vendor/github.com/google/go-github/v41/github/event.go +++ b/vendor/github.com/google/go-github/v42/github/event.go @@ -50,6 +50,8 @@ func (e *Event) ParsePayload() (payload interface{}, err error) { payload = &DeploymentEvent{} case "DeploymentStatusEvent": payload = &DeploymentStatusEvent{} + case "DiscussionEvent": + payload = &DiscussionEvent{} case "ForkEvent": payload = &ForkEvent{} case "GitHubAppAuthorizationEvent": diff --git a/vendor/github.com/google/go-github/v41/github/event_types.go b/vendor/github.com/google/go-github/v42/github/event_types.go similarity index 93% rename from vendor/github.com/google/go-github/v41/github/event_types.go rename to vendor/github.com/google/go-github/v42/github/event_types.go index 5c81115877..6a806c4a1e 100644 --- a/vendor/github.com/google/go-github/v41/github/event_types.go +++ b/vendor/github.com/google/go-github/v42/github/event_types.go @@ -20,12 +20,13 @@ type RequestedAction struct { // // GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule type BranchProtectionRuleEvent struct { - Action *string `json:"action,omitempty"` - Rule *BranchProtectionRule `json:"rule,omitempty"` - Changes *ProtectionChanges `json:"changes,omitempty"` - Repo *Repository `json:"repository,omitempty"` - Org *Organization `json:"organization,omitempty"` - Sender *User `json:"sender,omitempty"` + Action *string `json:"action,omitempty"` + Rule *BranchProtectionRule `json:"rule,omitempty"` + Changes *ProtectionChanges `json:"changes,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` } // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". @@ -179,6 +180,59 @@ type DeploymentStatusEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DiscussionEvent represents a webhook event for a discussion. +// The Webhook event name is "discussion". +// +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion +type DiscussionEvent struct { + // Action is the action that was performed. Possible values are: + // created, edited, deleted, pinned, unpinned, locked, unlocked, + // transferred, category_changed, answered, or unanswered. + Action *string `json:"action,omitempty"` + Discussion *Discussion `json:"discussion,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + +// Discussion represents a discussion in a GitHub DiscussionEvent. +type Discussion struct { + RepositoryURL *string `json:"repository_url,omitempty"` + DiscussionCategory *DiscussionCategory `json:"category,omitempty"` + AnswerHTMLURL *string `json:"answer_html_url,omitempty"` + AnswerChosenAt *Timestamp `json:"answer_chosen_at,omitempty"` + AnswerChosenBy *string `json:"answer_chosen_by,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Number *int `json:"number,omitempty"` + Title *string `json:"title,omitempty"` + User *User `json:"user,omitempty"` + State *string `json:"state,omitempty"` + Locked *bool `json:"locked,omitempty"` + Comments *int `json:"comments,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + AuthorAssociation *string `json:"author_association,omitempty"` + ActiveLockReason *string `json:"active_lock_reason,omitempty"` + Body *string `json:"body,omitempty"` +} + +// DiscussionCategory represents a discussion category in a GitHub DiscussionEvent. +type DiscussionCategory struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + Emoji *string `json:"emoji,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Slug *string `json:"slug,omitempty"` + IsAnswerable *bool `json:"is_answerable,omitempty"` +} + // ForkEvent is triggered when a user forks a repository. // The Webhook event name is "fork". // @@ -229,12 +283,13 @@ type GollumEvent struct { Installation *Installation `json:"installation,omitempty"` } -// EditChange represents the changes when an issue, pull request, or comment has -// been edited. +// EditChange represents the changes when an issue, pull request, comment, +// or repository has been edited. type EditChange struct { Title *EditTitle `json:"title,omitempty"` Body *EditBody `json:"body,omitempty"` Base *EditBase `json:"base,omitempty"` + Repo *EditRepo `json:"repository,omitempty"` } // EditTitle represents a pull-request title change. @@ -258,6 +313,16 @@ type EditRef struct { From *string `json:"from,omitempty"` } +// EditRepo represents a change of repository name. +type EditRepo struct { + Name *RepoName `json:"name,omitempty"` +} + +// RepoName represents a change of repository name. +type RepoName struct { + From *string `json:"from,omitempty"` +} + // EditSHA represents a sha change of a pull-request. type EditSHA struct { From *string `json:"from,omitempty"` @@ -937,6 +1002,7 @@ type RepositoryEvent struct { Repo *Repository `json:"repository,omitempty"` // The following fields are only populated by Webhook events. + Changes *EditChange `json:"changes,omitempty"` Org *Organization `json:"organization,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` diff --git a/vendor/github.com/google/go-github/v41/github/gists.go b/vendor/github.com/google/go-github/v42/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/gists.go rename to vendor/github.com/google/go-github/v42/github/gists.go diff --git a/vendor/github.com/google/go-github/v41/github/gists_comments.go b/vendor/github.com/google/go-github/v42/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/gists_comments.go rename to vendor/github.com/google/go-github/v42/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v41/github/git.go b/vendor/github.com/google/go-github/v42/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/git.go rename to vendor/github.com/google/go-github/v42/github/git.go diff --git a/vendor/github.com/google/go-github/v41/github/git_blobs.go b/vendor/github.com/google/go-github/v42/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/git_blobs.go rename to vendor/github.com/google/go-github/v42/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v41/github/git_commits.go b/vendor/github.com/google/go-github/v42/github/git_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/git_commits.go rename to vendor/github.com/google/go-github/v42/github/git_commits.go diff --git a/vendor/github.com/google/go-github/v41/github/git_refs.go b/vendor/github.com/google/go-github/v42/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/git_refs.go rename to vendor/github.com/google/go-github/v42/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v41/github/git_tags.go b/vendor/github.com/google/go-github/v42/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/git_tags.go rename to vendor/github.com/google/go-github/v42/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v41/github/git_trees.go b/vendor/github.com/google/go-github/v42/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/git_trees.go rename to vendor/github.com/google/go-github/v42/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v41/github/github-accessors.go b/vendor/github.com/google/go-github/v42/github/github-accessors.go similarity index 96% rename from vendor/github.com/google/go-github/v41/github/github-accessors.go rename to vendor/github.com/google/go-github/v42/github/github-accessors.go index b6a846eff3..12d6019f0a 100644 --- a/vendor/github.com/google/go-github/v41/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v42/github/github-accessors.go @@ -300,6 +300,22 @@ func (a *Alert) GetURL() string { return *a.URL } +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (a *AnalysesListOptions) GetRef() string { + if a == nil || a.Ref == nil { + return "" + } + return *a.Ref +} + +// GetSarifID returns the SarifID field if it's non-nil, zero value otherwise. +func (a *AnalysesListOptions) GetSarifID() string { + if a == nil || a.SarifID == nil { + return "" + } + return *a.SarifID +} + // GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise. func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { if a == nil || a.VerifiablePasswordAuthentication == nil { @@ -1588,6 +1604,14 @@ func (b *BranchProtectionRuleEvent) GetChanges() *ProtectionChanges { return b.Changes } +// GetInstallation returns the Installation field. +func (b *BranchProtectionRuleEvent) GetInstallation() *Installation { + if b == nil { + return nil + } + return b.Installation +} + // GetOrg returns the Org field. func (b *BranchProtectionRuleEvent) GetOrg() *Organization { if b == nil { @@ -3820,6 +3844,238 @@ func (d *DeploymentStatusRequest) GetState() string { return *d.State } +// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise. +func (d *Discussion) GetActiveLockReason() string { + if d == nil || d.ActiveLockReason == nil { + return "" + } + return *d.ActiveLockReason +} + +// GetAnswerChosenAt returns the AnswerChosenAt field if it's non-nil, zero value otherwise. +func (d *Discussion) GetAnswerChosenAt() Timestamp { + if d == nil || d.AnswerChosenAt == nil { + return Timestamp{} + } + return *d.AnswerChosenAt +} + +// GetAnswerChosenBy returns the AnswerChosenBy field if it's non-nil, zero value otherwise. +func (d *Discussion) GetAnswerChosenBy() string { + if d == nil || d.AnswerChosenBy == nil { + return "" + } + return *d.AnswerChosenBy +} + +// GetAnswerHTMLURL returns the AnswerHTMLURL field if it's non-nil, zero value otherwise. +func (d *Discussion) GetAnswerHTMLURL() string { + if d == nil || d.AnswerHTMLURL == nil { + return "" + } + return *d.AnswerHTMLURL +} + +// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise. +func (d *Discussion) GetAuthorAssociation() string { + if d == nil || d.AuthorAssociation == nil { + return "" + } + return *d.AuthorAssociation +} + +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (d *Discussion) GetBody() string { + if d == nil || d.Body == nil { + return "" + } + return *d.Body +} + +// GetComments returns the Comments field if it's non-nil, zero value otherwise. +func (d *Discussion) GetComments() int { + if d == nil || d.Comments == nil { + return 0 + } + return *d.Comments +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *Discussion) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetDiscussionCategory returns the DiscussionCategory field. +func (d *Discussion) GetDiscussionCategory() *DiscussionCategory { + if d == nil { + return nil + } + return d.DiscussionCategory +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *Discussion) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { + return "" + } + return *d.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *Discussion) GetID() int64 { + if d == nil || d.ID == nil { + return 0 + } + return *d.ID +} + +// GetLocked returns the Locked field if it's non-nil, zero value otherwise. +func (d *Discussion) GetLocked() bool { + if d == nil || d.Locked == nil { + return false + } + return *d.Locked +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (d *Discussion) GetNodeID() string { + if d == nil || d.NodeID == nil { + return "" + } + return *d.NodeID +} + +// GetNumber returns the Number field if it's non-nil, zero value otherwise. +func (d *Discussion) GetNumber() int { + if d == nil || d.Number == nil { + return 0 + } + return *d.Number +} + +// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. +func (d *Discussion) GetRepositoryURL() string { + if d == nil || d.RepositoryURL == nil { + return "" + } + return *d.RepositoryURL +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (d *Discussion) GetState() string { + if d == nil || d.State == nil { + return "" + } + return *d.State +} + +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (d *Discussion) GetTitle() string { + if d == nil || d.Title == nil { + return "" + } + return *d.Title +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *Discussion) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + +// GetUser returns the User field. +func (d *Discussion) GetUser() *User { + if d == nil { + return nil + } + return d.User +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetDescription() string { + if d == nil || d.Description == nil { + return "" + } + return *d.Description +} + +// GetEmoji returns the Emoji field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetEmoji() string { + if d == nil || d.Emoji == nil { + return "" + } + return *d.Emoji +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetID() int64 { + if d == nil || d.ID == nil { + return 0 + } + return *d.ID +} + +// GetIsAnswerable returns the IsAnswerable field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetIsAnswerable() bool { + if d == nil || d.IsAnswerable == nil { + return false + } + return *d.IsAnswerable +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetNodeID() string { + if d == nil || d.NodeID == nil { + return "" + } + return *d.NodeID +} + +// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetRepositoryID() int64 { + if d == nil || d.RepositoryID == nil { + return 0 + } + return *d.RepositoryID +} + +// GetSlug returns the Slug field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetSlug() string { + if d == nil || d.Slug == nil { + return "" + } + return *d.Slug +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (d *DiscussionCategory) GetUpdatedAt() Timestamp { + if d == nil || d.UpdatedAt == nil { + return Timestamp{} + } + return *d.UpdatedAt +} + // GetAuthor returns the Author field. func (d *DiscussionComment) GetAuthor() *User { if d == nil { @@ -3924,6 +4180,54 @@ func (d *DiscussionComment) GetURL() string { return *d.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DiscussionEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + +// GetDiscussion returns the Discussion field. +func (d *DiscussionEvent) GetDiscussion() *Discussion { + if d == nil { + return nil + } + return d.Discussion +} + +// GetInstallation returns the Installation field. +func (d *DiscussionEvent) GetInstallation() *Installation { + if d == nil { + return nil + } + return d.Installation +} + +// GetOrg returns the Org field. +func (d *DiscussionEvent) GetOrg() *Organization { + if d == nil { + return nil + } + return d.Org +} + +// GetRepo returns the Repo field. +func (d *DiscussionEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetSender returns the Sender field. +func (d *DiscussionEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + // GetTeams returns the Teams field if it's non-nil, zero value otherwise. func (d *DismissalRestrictionsRequest) GetTeams() []string { if d == nil || d.Teams == nil { @@ -4076,6 +4380,14 @@ func (e *EditChange) GetBody() *EditBody { return e.Body } +// GetRepo returns the Repo field. +func (e *EditChange) GetRepo() *EditRepo { + if e == nil { + return nil + } + return e.Repo +} + // GetTitle returns the Title field. func (e *EditChange) GetTitle() *EditTitle { if e == nil { @@ -4092,6 +4404,14 @@ func (e *EditRef) GetFrom() string { return *e.From } +// GetName returns the Name field. +func (e *EditRepo) GetName() *RepoName { + if e == nil { + return nil + } + return e.Name +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (e *EditSHA) GetFrom() string { if e == nil || e.From == nil { @@ -4388,6 +4708,78 @@ func (e *Event) GetType() string { return *e.Type } +// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise. +func (e *ExternalGroup) GetGroupID() int64 { + if e == nil || e.GroupID == nil { + return 0 + } + return *e.GroupID +} + +// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise. +func (e *ExternalGroup) GetGroupName() string { + if e == nil || e.GroupName == nil { + return "" + } + return *e.GroupName +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (e *ExternalGroup) GetUpdatedAt() Timestamp { + if e == nil || e.UpdatedAt == nil { + return Timestamp{} + } + return *e.UpdatedAt +} + +// GetMemberEmail returns the MemberEmail field if it's non-nil, zero value otherwise. +func (e *ExternalGroupMember) GetMemberEmail() string { + if e == nil || e.MemberEmail == nil { + return "" + } + return *e.MemberEmail +} + +// GetMemberID returns the MemberID field if it's non-nil, zero value otherwise. +func (e *ExternalGroupMember) GetMemberID() int64 { + if e == nil || e.MemberID == nil { + return 0 + } + return *e.MemberID +} + +// GetMemberLogin returns the MemberLogin field if it's non-nil, zero value otherwise. +func (e *ExternalGroupMember) GetMemberLogin() string { + if e == nil || e.MemberLogin == nil { + return "" + } + return *e.MemberLogin +} + +// GetMemberName returns the MemberName field if it's non-nil, zero value otherwise. +func (e *ExternalGroupMember) GetMemberName() string { + if e == nil || e.MemberName == nil { + return "" + } + return *e.MemberName +} + +// GetTeamID returns the TeamID field if it's non-nil, zero value otherwise. +func (e *ExternalGroupTeam) GetTeamID() int64 { + if e == nil || e.TeamID == nil { + return 0 + } + return *e.TeamID +} + +// GetTeamName returns the TeamName field if it's non-nil, zero value otherwise. +func (e *ExternalGroupTeam) GetTeamName() string { + if e == nil || e.TeamName == nil { + return "" + } + return *e.TeamName +} + // GetHRef returns the HRef field if it's non-nil, zero value otherwise. func (f *FeedLink) GetHRef() string { if f == nil || f.HRef == nil { @@ -5341,9 +5733,9 @@ func (h *HookDelivery) GetID() int64 { } // GetInstallationID returns the InstallationID field if it's non-nil, zero value otherwise. -func (h *HookDelivery) GetInstallationID() string { +func (h *HookDelivery) GetInstallationID() int64 { if h == nil || h.InstallationID == nil { - return "" + return 0 } return *h.InstallationID } @@ -7484,6 +7876,14 @@ func (l *License) GetURL() string { return *l.URL } +// GetAppID returns the AppID field if it's non-nil, zero value otherwise. +func (l *ListCheckRunsOptions) GetAppID() int64 { + if l == nil || l.AppID == nil { + return 0 + } + return *l.AppID +} + // GetCheckName returns the CheckName field if it's non-nil, zero value otherwise. func (l *ListCheckRunsOptions) GetCheckName() string { if l == nil || l.CheckName == nil { @@ -7548,6 +7948,14 @@ func (l *ListCollaboratorOptions) GetAffiliation() string { return *l.Affiliation } +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (l *ListExternalGroupsOptions) GetDisplayName() string { + if l == nil || l.DisplayName == nil { + return "" + } + return *l.DisplayName +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (l *ListRepositories) GetTotalCount() int { if l == nil || l.TotalCount == nil { @@ -9900,6 +10308,30 @@ func (p *Pages) GetHTMLURL() string { return *p.HTMLURL } +// GetHTTPSCertificate returns the HTTPSCertificate field. +func (p *Pages) GetHTTPSCertificate() *PagesHTTPSCertificate { + if p == nil { + return nil + } + return p.HTTPSCertificate +} + +// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. +func (p *Pages) GetHTTPSEnforced() bool { + if p == nil || p.HTTPSEnforced == nil { + return false + } + return *p.HTTPSEnforced +} + +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *Pages) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + // GetSource returns the Source field. func (p *Pages) GetSource() *PagesSource { if p == nil { @@ -9996,6 +10428,30 @@ func (p *PagesError) GetMessage() string { return *p.Message } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PagesHTTPSCertificate) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (p *PagesHTTPSCertificate) GetExpiresAt() string { + if p == nil || p.ExpiresAt == nil { + return "" + } + return *p.ExpiresAt +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (p *PagesHTTPSCertificate) GetState() string { + if p == nil || p.State == nil { + return "" + } + return *p.State +} + // GetBranch returns the Branch field if it's non-nil, zero value otherwise. func (p *PagesSource) GetBranch() string { if p == nil || p.Branch == nil { @@ -10292,6 +10748,14 @@ func (p *Project) GetNumber() int { return *p.Number } +// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise. +func (p *Project) GetOrganizationPermission() string { + if p == nil || p.OrganizationPermission == nil { + return "" + } + return *p.OrganizationPermission +} + // GetOwnerURL returns the OwnerURL field if it's non-nil, zero value otherwise. func (p *Project) GetOwnerURL() string { if p == nil || p.OwnerURL == nil { @@ -10300,6 +10764,14 @@ func (p *Project) GetOwnerURL() string { return *p.OwnerURL } +// GetPrivate returns the Private field if it's non-nil, zero value otherwise. +func (p *Project) GetPrivate() bool { + if p == nil || p.Private == nil { + return false + } + return *p.Private +} + // GetState returns the State field if it's non-nil, zero value otherwise. func (p *Project) GetState() string { if p == nil || p.State == nil { @@ -10804,12 +11276,12 @@ func (p *ProjectOptions) GetOrganizationPermission() string { return *p.OrganizationPermission } -// GetPublic returns the Public field if it's non-nil, zero value otherwise. -func (p *ProjectOptions) GetPublic() bool { - if p == nil || p.Public == nil { +// GetPrivate returns the Private field if it's non-nil, zero value otherwise. +func (p *ProjectOptions) GetPrivate() bool { + if p == nil || p.Private == nil { return false } - return *p.Public + return *p.Private } // GetState returns the State field if it's non-nil, zero value otherwise. @@ -13108,6 +13580,14 @@ func (r *RenameOrgResponse) GetURL() string { return *r.URL } +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RepoName) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetIncompleteResults() bool { if r == nil || r.IncompleteResults == nil { @@ -14244,6 +14724,14 @@ func (r *RepositoryEvent) GetAction() string { return *r.Action } +// GetChanges returns the Changes field. +func (r *RepositoryEvent) GetChanges() *EditChange { + if r == nil { + return nil + } + return r.Changes +} + // GetInstallation returns the Installation field. func (r *RepositoryEvent) GetInstallation() *Installation { if r == nil { @@ -15244,6 +15732,126 @@ func (s *SarifID) GetURL() string { return *s.URL } +// GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetAnalysisKey() string { + if s == nil || s.AnalysisKey == nil { + return "" + } + return *s.AnalysisKey +} + +// GetCategory returns the Category field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetCategory() string { + if s == nil || s.Category == nil { + return "" + } + return *s.Category +} + +// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetCommitSHA() string { + if s == nil || s.CommitSHA == nil { + return "" + } + return *s.CommitSHA +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetCreatedAt() Timestamp { + if s == nil || s.CreatedAt == nil { + return Timestamp{} + } + return *s.CreatedAt +} + +// GetDeletable returns the Deletable field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetDeletable() bool { + if s == nil || s.Deletable == nil { + return false + } + return *s.Deletable +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetEnvironment() string { + if s == nil || s.Environment == nil { + return "" + } + return *s.Environment +} + +// GetError returns the Error field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetError() string { + if s == nil || s.Error == nil { + return "" + } + return *s.Error +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetID() int64 { + if s == nil || s.ID == nil { + return 0 + } + return *s.ID +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetRef() string { + if s == nil || s.Ref == nil { + return "" + } + return *s.Ref +} + +// GetResultsCount returns the ResultsCount field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetResultsCount() int { + if s == nil || s.ResultsCount == nil { + return 0 + } + return *s.ResultsCount +} + +// GetRulesCount returns the RulesCount field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetRulesCount() int { + if s == nil || s.RulesCount == nil { + return 0 + } + return *s.RulesCount +} + +// GetSarifID returns the SarifID field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetSarifID() string { + if s == nil || s.SarifID == nil { + return "" + } + return *s.SarifID +} + +// GetTool returns the Tool field. +func (s *ScanningAnalysis) GetTool() *Tool { + if s == nil { + return nil + } + return s.Tool +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + +// GetWarning returns the Warning field if it's non-nil, zero value otherwise. +func (s *ScanningAnalysis) GetWarning() string { + if s == nil || s.Warning == nil { + return "" + } + return *s.Warning +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetActive() bool { if s == nil || s.Active == nil { @@ -15836,6 +16444,14 @@ func (t *Team) GetDescription() string { return *t.Description } +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (t *Team) GetHTMLURL() string { + if t == nil || t.HTMLURL == nil { + return "" + } + return *t.HTMLURL +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (t *Team) GetID() int64 { if t == nil || t.ID == nil { @@ -18540,6 +19156,14 @@ func (w *WorkflowRun) GetNodeID() string { return *w.NodeID } +// GetPreviousAttemptURL returns the PreviousAttemptURL field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetPreviousAttemptURL() string { + if w == nil || w.PreviousAttemptURL == nil { + return "" + } + return *w.PreviousAttemptURL +} + // GetRepository returns the Repository field. func (w *WorkflowRun) GetRepository() *Repository { if w == nil { @@ -18556,6 +19180,14 @@ func (w *WorkflowRun) GetRerunURL() string { return *w.RerunURL } +// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetRunAttempt() int { + if w == nil || w.RunAttempt == nil { + return 0 + } + return *w.RunAttempt +} + // GetRunNumber returns the RunNumber field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetRunNumber() int { if w == nil || w.RunNumber == nil { @@ -18564,6 +19196,14 @@ func (w *WorkflowRun) GetRunNumber() int { return *w.RunNumber } +// GetRunStartedAt returns the RunStartedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetRunStartedAt() Timestamp { + if w == nil || w.RunStartedAt == nil { + return Timestamp{} + } + return *w.RunStartedAt +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetStatus() string { if w == nil || w.Status == nil { diff --git a/vendor/github.com/google/go-github/v41/github/github.go b/vendor/github.com/google/go-github/v42/github/github.go similarity index 99% rename from vendor/github.com/google/go-github/v41/github/github.go rename to vendor/github.com/google/go-github/v42/github/github.go index a7afd83436..4fb466e3a6 100644 --- a/vendor/github.com/google/go-github/v41/github/github.go +++ b/vendor/github.com/google/go-github/v42/github/github.go @@ -178,6 +178,7 @@ type Client struct { Billing *BillingService Checks *ChecksService CodeScanning *CodeScanningService + Dependabot *DependabotService Enterprise *EnterpriseService Gists *GistsService Git *GitService @@ -306,6 +307,7 @@ func NewClient(httpClient *http.Client) *Client { c.Billing = (*BillingService)(&c.common) c.Checks = (*ChecksService)(&c.common) c.CodeScanning = (*CodeScanningService)(&c.common) + c.Dependabot = (*DependabotService)(&c.common) c.Enterprise = (*EnterpriseService)(&c.common) c.Gists = (*GistsService)(&c.common) c.Git = (*GitService)(&c.common) @@ -544,7 +546,7 @@ func (r *Response) populatePageValues() { continue } - if since != "" { + if since != "" && page == "" { page = since } @@ -884,7 +886,7 @@ func (ae *AcceptedError) Is(target error) bool { } // AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the -// "documentation_url" field value equal to "https://docs.github.com/en/free-pro-team@latest/rest/reference/#abuse-rate-limits". +// "documentation_url" field value equal to "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits". type AbuseRateLimitError struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message @@ -1003,7 +1005,9 @@ func CheckResponse(r *http.Response) error { Response: errorResponse.Response, Message: errorResponse.Message, } - case r.StatusCode == http.StatusForbidden && strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits"): + case r.StatusCode == http.StatusForbidden && + (strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") || + strings.HasSuffix(errorResponse.DocumentationURL, "#secondary-rate-limits")): abuseRateLimitError := &AbuseRateLimitError{ Response: errorResponse.Response, Message: errorResponse.Message, diff --git a/vendor/github.com/google/go-github/v41/github/gitignore.go b/vendor/github.com/google/go-github/v42/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/gitignore.go rename to vendor/github.com/google/go-github/v42/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v41/github/interactions.go b/vendor/github.com/google/go-github/v42/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/interactions.go rename to vendor/github.com/google/go-github/v42/github/interactions.go diff --git a/vendor/github.com/google/go-github/v41/github/interactions_orgs.go b/vendor/github.com/google/go-github/v42/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v42/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v41/github/interactions_repos.go b/vendor/github.com/google/go-github/v42/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/interactions_repos.go rename to vendor/github.com/google/go-github/v42/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v41/github/issue_import.go b/vendor/github.com/google/go-github/v42/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issue_import.go rename to vendor/github.com/google/go-github/v42/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v41/github/issues.go b/vendor/github.com/google/go-github/v42/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues.go rename to vendor/github.com/google/go-github/v42/github/issues.go diff --git a/vendor/github.com/google/go-github/v41/github/issues_assignees.go b/vendor/github.com/google/go-github/v42/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues_assignees.go rename to vendor/github.com/google/go-github/v42/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v41/github/issues_comments.go b/vendor/github.com/google/go-github/v42/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues_comments.go rename to vendor/github.com/google/go-github/v42/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v41/github/issues_events.go b/vendor/github.com/google/go-github/v42/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues_events.go rename to vendor/github.com/google/go-github/v42/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v41/github/issues_labels.go b/vendor/github.com/google/go-github/v42/github/issues_labels.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues_labels.go rename to vendor/github.com/google/go-github/v42/github/issues_labels.go diff --git a/vendor/github.com/google/go-github/v41/github/issues_milestones.go b/vendor/github.com/google/go-github/v42/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues_milestones.go rename to vendor/github.com/google/go-github/v42/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v41/github/issues_timeline.go b/vendor/github.com/google/go-github/v42/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/issues_timeline.go rename to vendor/github.com/google/go-github/v42/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v41/github/licenses.go b/vendor/github.com/google/go-github/v42/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/licenses.go rename to vendor/github.com/google/go-github/v42/github/licenses.go diff --git a/vendor/github.com/google/go-github/v41/github/messages.go b/vendor/github.com/google/go-github/v42/github/messages.go similarity index 97% rename from vendor/github.com/google/go-github/v41/github/messages.go rename to vendor/github.com/google/go-github/v42/github/messages.go index 4a03890c7b..2e69c523e9 100644 --- a/vendor/github.com/google/go-github/v41/github/messages.go +++ b/vendor/github.com/google/go-github/v42/github/messages.go @@ -55,6 +55,7 @@ var ( "deploy_key": "DeployKeyEvent", "deployment": "DeploymentEvent", "deployment_status": "DeploymentStatusEvent", + "discussion": "DiscussionEvent", "fork": "ForkEvent", "github_app_authorization": "GitHubAppAuthorizationEvent", "gollum": "GollumEvent", @@ -255,14 +256,14 @@ func ValidateSignature(signature string, payload, secretToken []byte) error { // WebHookType returns the event type of webhook request r. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/hooks/#webhook-headers +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types func WebHookType(r *http.Request) string { 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 +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types func DeliveryID(r *http.Request) string { return r.Header.Get(DeliveryIDHeader) } diff --git a/vendor/github.com/google/go-github/v41/github/migrations.go b/vendor/github.com/google/go-github/v42/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/migrations.go rename to vendor/github.com/google/go-github/v42/github/migrations.go diff --git a/vendor/github.com/google/go-github/v41/github/migrations_source_import.go b/vendor/github.com/google/go-github/v42/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v42/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v41/github/migrations_user.go b/vendor/github.com/google/go-github/v42/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/migrations_user.go rename to vendor/github.com/google/go-github/v42/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v41/github/misc.go b/vendor/github.com/google/go-github/v42/github/misc.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/misc.go rename to vendor/github.com/google/go-github/v42/github/misc.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs.go b/vendor/github.com/google/go-github/v42/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs.go rename to vendor/github.com/google/go-github/v42/github/orgs.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v42/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v42/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v42/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v42/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v42/github/orgs_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v42/github/orgs_audit_log.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_hooks.go b/vendor/github.com/google/go-github/v42/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v42/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v42/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v42/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_members.go b/vendor/github.com/google/go-github/v42/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_members.go rename to vendor/github.com/google/go-github/v42/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v42/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v42/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_packages.go b/vendor/github.com/google/go-github/v42/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_packages.go rename to vendor/github.com/google/go-github/v42/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_projects.go b/vendor/github.com/google/go-github/v42/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_projects.go rename to vendor/github.com/google/go-github/v42/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v41/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v42/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v42/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v41/github/packages.go b/vendor/github.com/google/go-github/v42/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/packages.go rename to vendor/github.com/google/go-github/v42/github/packages.go diff --git a/vendor/github.com/google/go-github/v41/github/projects.go b/vendor/github.com/google/go-github/v42/github/projects.go similarity index 95% rename from vendor/github.com/google/go-github/v41/github/projects.go rename to vendor/github.com/google/go-github/v42/github/projects.go index 12c00bc3b7..2886c3a3b0 100644 --- a/vendor/github.com/google/go-github/v41/github/projects.go +++ b/vendor/github.com/google/go-github/v42/github/projects.go @@ -18,18 +18,20 @@ type ProjectsService service // Project represents a GitHub Project. type Project struct { - ID *int64 `json:"id,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - ColumnsURL *string `json:"columns_url,omitempty"` - OwnerURL *string `json:"owner_url,omitempty"` - Name *string `json:"name,omitempty"` - Body *string `json:"body,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - NodeID *string `json:"node_id,omitempty"` + ID *int64 `json:"id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ColumnsURL *string `json:"columns_url,omitempty"` + OwnerURL *string `json:"owner_url,omitempty"` + Name *string `json:"name,omitempty"` + Body *string `json:"body,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + NodeID *string `json:"node_id,omitempty"` + OrganizationPermission *string `json:"organization_permission,omitempty"` + Private *bool `json:"private,omitempty"` // The User object that generated the project. Creator *User `json:"creator,omitempty"` @@ -83,7 +85,7 @@ type ProjectOptions struct { // Sets visibility of the project within the organization. // Setting visibility is only available // for organization projects.(Optional.) - Public *bool `json:"public,omitempty"` + Private *bool `json:"private,omitempty"` } // UpdateProject updates a repository project. diff --git a/vendor/github.com/google/go-github/v41/github/pulls.go b/vendor/github.com/google/go-github/v42/github/pulls.go similarity index 98% rename from vendor/github.com/google/go-github/v41/github/pulls.go rename to vendor/github.com/google/go-github/v42/github/pulls.go index 6c866ea884..37fb7413a4 100644 --- a/vendor/github.com/google/go-github/v41/github/pulls.go +++ b/vendor/github.com/google/go-github/v42/github/pulls.go @@ -167,9 +167,10 @@ func (s *PullRequestsService) List(ctx context.Context, owner string, repo strin // ListPullRequestsWithCommit returns pull requests associated with a commit SHA. // -// The results will include open and closed pull requests. +// The results may include open and closed pull requests. +// By default, the PullRequestListOptions State filters for "open". // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#list-pull-requests-associated-with-a-commit +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/commits/#list-pull-requests-associated-with-a-commit func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v/pulls", owner, repo, sha) u, err := addOptions(u, opts) diff --git a/vendor/github.com/google/go-github/v41/github/pulls_comments.go b/vendor/github.com/google/go-github/v42/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/pulls_comments.go rename to vendor/github.com/google/go-github/v42/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v41/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v42/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v42/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v41/github/pulls_reviews.go b/vendor/github.com/google/go-github/v42/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v42/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v41/github/reactions.go b/vendor/github.com/google/go-github/v42/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/reactions.go rename to vendor/github.com/google/go-github/v42/github/reactions.go diff --git a/vendor/github.com/google/go-github/v41/github/repos.go b/vendor/github.com/google/go-github/v42/github/repos.go similarity index 99% rename from vendor/github.com/google/go-github/v41/github/repos.go rename to vendor/github.com/google/go-github/v42/github/repos.go index 45c4618094..2239c70001 100644 --- a/vendor/github.com/google/go-github/v41/github/repos.go +++ b/vendor/github.com/google/go-github/v42/github/repos.go @@ -8,11 +8,16 @@ package github import ( "context" "encoding/json" + "errors" "fmt" "net/http" "strings" ) +const githubBranchNotProtected string = "Branch not protected" + +var ErrBranchNotProtected = errors.New("branch is not protected") + // RepositoriesService handles communication with the repository related // methods of the GitHub API. // @@ -1117,6 +1122,9 @@ func (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, re p := new(Protection) resp, err := s.client.Do(ctx, req, p) if err != nil { + if isBranchNotProtected(err) { + err = ErrBranchNotProtected + } return nil, resp, err } @@ -1136,6 +1144,9 @@ func (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner p := new(RequiredStatusChecks) resp, err := s.client.Do(ctx, req, p) if err != nil { + if isBranchNotProtected(err) { + err = ErrBranchNotProtected + } return nil, resp, err } @@ -1154,6 +1165,9 @@ func (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Conte resp, err = s.client.Do(ctx, req, &contexts) if err != nil { + if isBranchNotProtected(err) { + err = ErrBranchNotProtected + } return nil, resp, err } @@ -1647,3 +1661,10 @@ func (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, return r, resp, nil } + +// isBranchNotProtected determines whether a branch is not protected +// based on the error message returned by GitHub API. +func isBranchNotProtected(err error) bool { + errorResponse, ok := err.(*ErrorResponse) + return ok && errorResponse.Message == githubBranchNotProtected +} diff --git a/vendor/github.com/google/go-github/v41/github/repos_autolinks.go b/vendor/github.com/google/go-github/v42/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v42/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_collaborators.go b/vendor/github.com/google/go-github/v42/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v42/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_comments.go b/vendor/github.com/google/go-github/v42/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_comments.go rename to vendor/github.com/google/go-github/v42/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_commits.go b/vendor/github.com/google/go-github/v42/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_commits.go rename to vendor/github.com/google/go-github/v42/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_community_health.go b/vendor/github.com/google/go-github/v42/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_community_health.go rename to vendor/github.com/google/go-github/v42/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_contents.go b/vendor/github.com/google/go-github/v42/github/repos_contents.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_contents.go rename to vendor/github.com/google/go-github/v42/github/repos_contents.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_deployments.go b/vendor/github.com/google/go-github/v42/github/repos_deployments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_deployments.go rename to vendor/github.com/google/go-github/v42/github/repos_deployments.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_environments.go b/vendor/github.com/google/go-github/v42/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_environments.go rename to vendor/github.com/google/go-github/v42/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_forks.go b/vendor/github.com/google/go-github/v42/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_forks.go rename to vendor/github.com/google/go-github/v42/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_hooks.go b/vendor/github.com/google/go-github/v42/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_hooks.go rename to vendor/github.com/google/go-github/v42/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v42/github/repos_hooks_deliveries.go similarity index 84% rename from vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v42/github/repos_hooks_deliveries.go index 122674463a..1713269519 100644 --- a/vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v42/github/repos_hooks_deliveries.go @@ -17,17 +17,17 @@ import ( // - 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"` + ID *int64 `json:"id,omitempty"` + GUID *string `json:"guid,omitempty"` + DeliveredAt *Timestamp `json:"delivered_at,omitempty"` + Redelivery *bool `json:"redelivery,omitempty"` + Duration *float64 `json:"duration,omitempty"` + Status *string `json:"status,omitempty"` + StatusCode *int `json:"status_code,omitempty"` + Event *string `json:"event,omitempty"` + Action *string `json:"action,omitempty"` + InstallationID *int64 `json:"installation_id,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` // Request is populated by GetHookDelivery. Request *HookRequest `json:"request,omitempty"` diff --git a/vendor/github.com/google/go-github/v41/github/repos_invitations.go b/vendor/github.com/google/go-github/v42/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_invitations.go rename to vendor/github.com/google/go-github/v42/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_keys.go b/vendor/github.com/google/go-github/v42/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_keys.go rename to vendor/github.com/google/go-github/v42/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_merging.go b/vendor/github.com/google/go-github/v42/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_merging.go rename to vendor/github.com/google/go-github/v42/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_pages.go b/vendor/github.com/google/go-github/v42/github/repos_pages.go similarity index 86% rename from vendor/github.com/google/go-github/v41/github/repos_pages.go rename to vendor/github.com/google/go-github/v42/github/repos_pages.go index a954e70584..04825baea1 100644 --- a/vendor/github.com/google/go-github/v41/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v42/github/repos_pages.go @@ -12,12 +12,15 @@ import ( // Pages represents a GitHub Pages site configuration. type Pages struct { - URL *string `json:"url,omitempty"` - Status *string `json:"status,omitempty"` - CNAME *string `json:"cname,omitempty"` - Custom404 *bool `json:"custom_404,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - Source *PagesSource `json:"source,omitempty"` + URL *string `json:"url,omitempty"` + Status *string `json:"status,omitempty"` + CNAME *string `json:"cname,omitempty"` + Custom404 *bool `json:"custom_404,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + Source *PagesSource `json:"source,omitempty"` + Public *bool `json:"public,omitempty"` + HTTPSCertificate *PagesHTTPSCertificate `json:"https_certificate,omitempty"` + HTTPSEnforced *bool `json:"https_enforced,omitempty"` } // PagesSource represents a GitHub page's source. @@ -43,6 +46,15 @@ type PagesBuild struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` } +// PagesHTTPSCertificate represents the HTTPS Certificate information for a GitHub Pages site. +type PagesHTTPSCertificate struct { + State *string `json:"state,omitempty"` + Description *string `json:"description,omitempty"` + Domains []string `json:"domains,omitempty"` + // GitHub's API doesn't return a standard Timestamp, rather it returns a YYYY-MM-DD string. + ExpiresAt *string `json:"expires_at,omitempty"` +} + // createPagesRequest is a subset of Pages and is used internally // by EnablePages to pass only the known fields for the endpoint. type createPagesRequest struct { diff --git a/vendor/github.com/google/go-github/v41/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v42/github/repos_prereceive_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v42/github/repos_prereceive_hooks.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_projects.go b/vendor/github.com/google/go-github/v42/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_projects.go rename to vendor/github.com/google/go-github/v42/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_releases.go b/vendor/github.com/google/go-github/v42/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_releases.go rename to vendor/github.com/google/go-github/v42/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_stats.go b/vendor/github.com/google/go-github/v42/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_stats.go rename to vendor/github.com/google/go-github/v42/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_statuses.go b/vendor/github.com/google/go-github/v42/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_statuses.go rename to vendor/github.com/google/go-github/v42/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v41/github/repos_traffic.go b/vendor/github.com/google/go-github/v42/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/repos_traffic.go rename to vendor/github.com/google/go-github/v42/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v41/github/scim.go b/vendor/github.com/google/go-github/v42/github/scim.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/scim.go rename to vendor/github.com/google/go-github/v42/github/scim.go diff --git a/vendor/github.com/google/go-github/v41/github/search.go b/vendor/github.com/google/go-github/v42/github/search.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/search.go rename to vendor/github.com/google/go-github/v42/github/search.go diff --git a/vendor/github.com/google/go-github/v41/github/strings.go b/vendor/github.com/google/go-github/v42/github/strings.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/strings.go rename to vendor/github.com/google/go-github/v42/github/strings.go diff --git a/vendor/github.com/google/go-github/v41/github/teams.go b/vendor/github.com/google/go-github/v42/github/teams.go similarity index 88% rename from vendor/github.com/google/go-github/v41/github/teams.go rename to vendor/github.com/google/go-github/v42/github/teams.go index 7a8a5d8a7b..82d4093b47 100644 --- a/vendor/github.com/google/go-github/v41/github/teams.go +++ b/vendor/github.com/google/go-github/v42/github/teams.go @@ -46,6 +46,7 @@ type Team struct { MembersCount *int `json:"members_count,omitempty"` ReposCount *int `json:"repos_count,omitempty"` Organization *Organization `json:"organization,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` MembersURL *string `json:"members_url,omitempty"` RepositoriesURL *string `json:"repositories_url,omitempty"` Parent *Team `json:"parent,omitempty"` @@ -854,3 +855,116 @@ func (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Conte return groups, resp, nil } + +// ExternalGroupMember represents a member of an external group. +type ExternalGroupMember struct { + MemberID *int64 `json:"member_id,omitempty"` + MemberLogin *string `json:"member_login,omitempty"` + MemberName *string `json:"member_name,omitempty"` + MemberEmail *string `json:"member_email,omitempty"` +} + +// ExternalGroupTeam represents a team connected to an external group. +type ExternalGroupTeam struct { + TeamID *int64 `json:"team_id,omitempty"` + TeamName *string `json:"team_name,omitempty"` +} + +// ExternalGroup represents an external group. +type ExternalGroup struct { + GroupID *int64 `json:"group_id,omitempty"` + GroupName *string `json:"group_name,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Teams []*ExternalGroupTeam `json:"teams,omitempty"` + Members []*ExternalGroupMember `json:"members,omitempty"` +} + +// ExternalGroupList represents a list of external groups. +type ExternalGroupList struct { + Groups []*ExternalGroup `json:"groups"` +} + +// GetExternalGroup fetches an external group. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#get-an-external-group +func (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) { + u := fmt.Sprintf("orgs/%v/external-group/%v", org, groupID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + externalGroup := new(ExternalGroup) + resp, err := s.client.Do(ctx, req, externalGroup) + if err != nil { + return nil, resp, err + } + + return externalGroup, resp, nil +} + +// ListExternalGroupsOptions specifies the optional parameters to the +// TeamsService.ListExternalGroups method. +type ListExternalGroupsOptions struct { + DisplayName *string `url:"display_name,omitempty"` + + ListOptions +} + +// ListExternalGroups lists external groups connected to a team on GitHub. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#list-external-groups-in-an-organization +func (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) { + u := fmt.Sprintf("orgs/%v/external-groups", org) + 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 + } + + externalGroups := new(ExternalGroupList) + resp, err := s.client.Do(ctx, req, externalGroups) + if err != nil { + return nil, resp, err + } + + return externalGroups, resp, nil +} + +// UpdateConnectedExternalGroup updates the connection between an external group and a team. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#update-the-connection-between-an-external-group-and-a-team +func (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) + + req, err := s.client.NewRequest("PATCH", u, eg) + if err != nil { + return nil, nil, err + } + + externalGroup := new(ExternalGroup) + resp, err := s.client.Do(ctx, req, externalGroup) + if err != nil { + return nil, resp, err + } + + return externalGroup, resp, nil +} + +// RemoveConnectedExternalGroup removes the connection between an external group and a team. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/reference/teams#remove-the-connection-between-an-external-group-and-a-team +func (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/teams/%v/external-groups", org, slug) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v41/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v42/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v42/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v41/github/teams_discussions.go b/vendor/github.com/google/go-github/v42/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/teams_discussions.go rename to vendor/github.com/google/go-github/v42/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v41/github/teams_members.go b/vendor/github.com/google/go-github/v42/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/teams_members.go rename to vendor/github.com/google/go-github/v42/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v41/github/timestamp.go b/vendor/github.com/google/go-github/v42/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/timestamp.go rename to vendor/github.com/google/go-github/v42/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v41/github/users.go b/vendor/github.com/google/go-github/v42/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users.go rename to vendor/github.com/google/go-github/v42/github/users.go diff --git a/vendor/github.com/google/go-github/v41/github/users_administration.go b/vendor/github.com/google/go-github/v42/github/users_administration.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_administration.go rename to vendor/github.com/google/go-github/v42/github/users_administration.go diff --git a/vendor/github.com/google/go-github/v41/github/users_blocking.go b/vendor/github.com/google/go-github/v42/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_blocking.go rename to vendor/github.com/google/go-github/v42/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v41/github/users_emails.go b/vendor/github.com/google/go-github/v42/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_emails.go rename to vendor/github.com/google/go-github/v42/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v41/github/users_followers.go b/vendor/github.com/google/go-github/v42/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_followers.go rename to vendor/github.com/google/go-github/v42/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v41/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v42/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v42/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v41/github/users_keys.go b/vendor/github.com/google/go-github/v42/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_keys.go rename to vendor/github.com/google/go-github/v42/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v41/github/users_packages.go b/vendor/github.com/google/go-github/v42/github/users_packages.go similarity index 97% rename from vendor/github.com/google/go-github/v41/github/users_packages.go rename to vendor/github.com/google/go-github/v42/github/users_packages.go index 4308b16e1b..cd20f8c189 100644 --- a/vendor/github.com/google/go-github/v41/github/users_packages.go +++ b/vendor/github.com/google/go-github/v42/github/users_packages.go @@ -115,13 +115,17 @@ func (s *UsersService) RestorePackage(ctx context.Context, user, packageType, pa // // GitHub API docs: https://docs.github.com/en/rest/reference/packages#get-all-package-versions-for-a-package-owned-by-the-authenticated-user // GitHub API docs: https://docs.github.com/en/rest/reference/users#delete-an-email-address-for-the-authenticated-user -func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string) ([]*PackageVersion, *Response, error) { +func (s *UsersService) PackageGetAllVersions(ctx context.Context, user, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) { var u string if user != "" { u = fmt.Sprintf("users/%v/packages/%v/%v/versions", user, packageType, packageName) } else { u = fmt.Sprintf("user/packages/%v/%v/versions", packageType, packageName) } + 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/v41/github/users_projects.go b/vendor/github.com/google/go-github/v42/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/users_projects.go rename to vendor/github.com/google/go-github/v42/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v41/github/with_appengine.go b/vendor/github.com/google/go-github/v42/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/with_appengine.go rename to vendor/github.com/google/go-github/v42/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v41/github/without_appengine.go b/vendor/github.com/google/go-github/v42/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v41/github/without_appengine.go rename to vendor/github.com/google/go-github/v42/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index b9a0b46f81..1814a7001f 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/v41 v41.0.0 +# github.com/google/go-github/v42 v42.0.0 ## explicit -github.com/google/go-github/v41/github +github.com/google/go-github/v42/github # github.com/google/go-querystring v1.1.0 github.com/google/go-querystring/query # github.com/google/uuid v1.1.1