From 5214d179ed814548ed6e975e1b6ec4243d226882 Mon Sep 17 00:00:00 2001 From: ihor-hrytskiv <39990360+ihor-hrytskiv@users.noreply.github.com> Date: Thu, 21 Nov 2024 01:16:29 +0200 Subject: [PATCH 1/3] feat!: Upgrade go-github to v66 (#2443) * feat: Upgrade go-github to v66 * feat!: remove tag protection endpoint * Empty commit to attempt to trigger tests --------- Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com> Co-authored-by: Keegan Campbell --- github/config.go | 2 +- ...urce_github_actions_environment_secrets.go | 2 +- ...ce_github_actions_environment_variables.go | 2 +- ...rce_github_actions_organization_secrets.go | 2 +- ...e_github_actions_organization_variables.go | 2 +- github/data_source_github_actions_secrets.go | 2 +- .../data_source_github_actions_variables.go | 2 +- github/data_source_github_app_token_test.go | 2 +- github/data_source_github_branch.go | 2 +- ..._github_codespaces_organization_secrets.go | 2 +- .../data_source_github_codespaces_secrets.go | 2 +- ...a_source_github_codespaces_user_secrets.go | 2 +- github/data_source_github_collaborators.go | 2 +- ..._github_dependabot_organization_secrets.go | 2 +- .../data_source_github_dependabot_secrets.go | 2 +- github/data_source_github_external_groups.go | 2 +- github/data_source_github_issue_labels.go | 2 +- github/data_source_github_organization.go | 2 +- ..._source_github_organization_custom_role.go | 2 +- ...ce_github_organization_team_sync_groups.go | 2 +- ...ata_source_github_organization_webhooks.go | 2 +- github/data_source_github_ref.go | 2 +- github/data_source_github_release.go | 2 +- github/data_source_github_repositories.go | 2 +- github/data_source_github_repository.go | 2 +- ...e_github_repository_autolink_references.go | 2 +- .../data_source_github_repository_branches.go | 2 +- ...ta_source_github_repository_deploy_keys.go | 2 +- ...a_source_github_repository_environments.go | 2 +- github/data_source_github_repository_file.go | 2 +- ...data_source_github_repository_file_test.go | 2 +- ..._source_github_repository_pull_requests.go | 2 +- github/data_source_github_repository_teams.go | 2 +- .../data_source_github_repository_webhooks.go | 2 +- github/data_source_github_team.go | 2 +- github/provider.go | 1 - github/repository_utils.go | 2 +- ...ource_github_actions_environment_secret.go | 2 +- ...rce_github_actions_environment_variable.go | 2 +- ...dc_subject_claim_customization_template.go | 2 +- ...github_actions_organization_permissions.go | 2 +- ...urce_github_actions_organization_secret.go | 2 +- ...ctions_organization_secret_repositories.go | 2 +- ...ce_github_actions_organization_variable.go | 2 +- ..._github_actions_repository_access_level.go | 2 +- ...dc_subject_claim_customization_template.go | 2 +- ...e_github_actions_repository_permissions.go | 2 +- .../resource_github_actions_runner_group.go | 2 +- github/resource_github_actions_secret.go | 2 +- github/resource_github_actions_variable.go | 2 +- ...ce_github_app_installation_repositories.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 +- ...e_github_codespaces_organization_secret.go | 2 +- ...spaces_organization_secret_repositories.go | 2 +- github/resource_github_codespaces_secret.go | 2 +- .../resource_github_codespaces_user_secret.go | 2 +- ...e_github_dependabot_organization_secret.go | 2 +- ...ndabot_organization_secret_repositories.go | 2 +- github/resource_github_dependabot_secret.go | 2 +- github/resource_github_emu_group_mapping.go | 2 +- ...e_github_enterprise_actions_permissions.go | 2 +- ..._github_enterprise_actions_runner_group.go | 2 +- ...resource_github_enterprise_organization.go | 2 +- github/resource_github_issue.go | 2 +- github/resource_github_issue_label.go | 2 +- github/resource_github_issue_labels.go | 2 +- github/resource_github_membership.go | 2 +- github/resource_github_membership_test.go | 2 +- ...esource_github_organization_custom_role.go | 2 +- .../resource_github_organization_project.go | 2 +- ...source_github_organization_project_test.go | 2 +- .../resource_github_organization_ruleset.go | 2 +- ...ce_github_organization_security_manager.go | 2 +- .../resource_github_organization_settings.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_release.go | 2 +- github/resource_github_repository.go | 2 +- ...ce_github_repository_autolink_reference.go | 2 +- ...resource_github_repository_collaborator.go | 2 +- ...esource_github_repository_collaborators.go | 2 +- ...ce_github_repository_collaborators_test.go | 2 +- .../resource_github_repository_deploy_key.go | 2 +- ...hub_repository_deployment_branch_policy.go | 2 +- .../resource_github_repository_environment.go | 2 +- ...epository_environment_deployment_policy.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_ruleset.go | 2 +- ...source_github_repository_tag_protection.go | 130 -- ...e_github_repository_tag_protection_test.go | 157 -- github/resource_github_repository_topics.go | 2 +- github/resource_github_repository_webhook.go | 2 +- github/resource_github_team.go | 2 +- github/resource_github_team_members.go | 2 +- github/resource_github_team_members_test.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/respository_rules_utils.go | 2 +- github/transport.go | 2 +- github/transport_test.go | 2 +- github/util.go | 2 +- go.mod | 2 +- go.sum | 4 +- .../google/go-github/{v65 => v66}/AUTHORS | 51 +- .../google/go-github/{v65 => v66}/LICENSE | 0 .../go-github/{v65 => v66}/github/actions.go | 0 .../{v65 => v66}/github/actions_artifacts.go | 12 +- .../{v65 => v66}/github/actions_cache.go | 4 +- .../{v65 => v66}/github/actions_oidc.go | 0 .../github/actions_permissions_enterprise.go | 0 .../github/actions_permissions_orgs.go | 0 .../github/actions_required_workflows.go | 0 .../github/actions_runner_groups.go | 0 .../{v65 => v66}/github/actions_runners.go | 0 .../{v65 => v66}/github/actions_secrets.go | 0 .../{v65 => v66}/github/actions_variables.go | 0 .../github/actions_workflow_jobs.go | 0 .../github/actions_workflow_runs.go | 64 + .../{v65 => v66}/github/actions_workflows.go | 0 .../go-github/{v65 => v66}/github/activity.go | 0 .../{v65 => v66}/github/activity_events.go | 0 .../github/activity_notifications.go | 17 + .../{v65 => v66}/github/activity_star.go | 0 .../{v65 => v66}/github/activity_watching.go | 0 .../go-github/{v65 => v66}/github/admin.go | 4 +- .../{v65 => v66}/github/admin_orgs.go | 6 +- .../{v65 => v66}/github/admin_stats.go | 2 +- .../{v65 => v66}/github/admin_users.go | 8 +- .../go-github/{v65 => v66}/github/apps.go | 0 .../{v65 => v66}/github/apps_hooks.go | 0 .../github/apps_hooks_deliveries.go | 0 .../{v65 => v66}/github/apps_installation.go | 0 .../{v65 => v66}/github/apps_manifest.go | 0 .../{v65 => v66}/github/apps_marketplace.go | 0 .../go-github/v66/github/attestations.go | 27 + .../{v65 => v66}/github/authorizations.go | 6 +- .../go-github/{v65 => v66}/github/billing.go | 0 .../go-github/{v65 => v66}/github/checks.go | 9 +- .../{v65 => v66}/github/code-scanning.go | 0 .../{v65 => v66}/github/codesofconduct.go | 4 +- .../{v65 => v66}/github/codespaces.go | 0 .../{v65 => v66}/github/codespaces_secrets.go | 0 .../go-github/{v65 => v66}/github/copilot.go | 171 +- .../{v65 => v66}/github/dependabot.go | 0 .../{v65 => v66}/github/dependabot_alerts.go | 0 .../{v65 => v66}/github/dependabot_secrets.go | 0 .../{v65 => v66}/github/dependency_graph.go | 0 .../github/dependency_graph_snapshots.go | 0 .../go-github/{v65 => v66}/github/doc.go | 4 +- .../go-github/{v65 => v66}/github/emojis.go | 2 +- .../{v65 => v66}/github/enterprise.go | 0 .../enterprise_actions_runner_groups.go | 0 .../github/enterprise_actions_runners.go | 0 .../github/enterprise_audit_log.go | 0 .../enterprise_code_security_and_analysis.go | 0 .../go-github/{v65 => v66}/github/event.go | 0 .../{v65 => v66}/github/event_types.go | 86 +- .../go-github/{v65 => v66}/github/gists.go | 0 .../{v65 => v66}/github/gists_comments.go | 0 .../go-github/{v65 => v66}/github/git.go | 0 .../{v65 => v66}/github/git_blobs.go | 0 .../{v65 => v66}/github/git_commits.go | 2 +- .../go-github/{v65 => v66}/github/git_refs.go | 0 .../go-github/{v65 => v66}/github/git_tags.go | 0 .../{v65 => v66}/github/git_trees.go | 0 .../{v65 => v66}/github/github-accessors.go | 1442 +++++++++++++++-- .../go-github/{v65 => v66}/github/github.go | 6 +- .../{v65 => v66}/github/gitignore.go | 0 .../{v65 => v66}/github/interactions.go | 0 .../{v65 => v66}/github/interactions_orgs.go | 0 .../{v65 => v66}/github/interactions_repos.go | 0 .../{v65 => v66}/github/issue_import.go | 0 .../go-github/{v65 => v66}/github/issues.go | 0 .../{v65 => v66}/github/issues_assignees.go | 0 .../{v65 => v66}/github/issues_comments.go | 0 .../{v65 => v66}/github/issues_events.go | 0 .../{v65 => v66}/github/issues_labels.go | 2 +- .../{v65 => v66}/github/issues_milestones.go | 0 .../{v65 => v66}/github/issues_timeline.go | 0 .../go-github/{v65 => v66}/github/licenses.go | 0 .../go-github/{v65 => v66}/github/markdown.go | 0 .../go-github/{v65 => v66}/github/messages.go | 140 +- .../go-github/{v65 => v66}/github/meta.go | 0 .../{v65 => v66}/github/migrations.go | 0 .../github/migrations_source_import.go | 2 +- .../{v65 => v66}/github/migrations_user.go | 0 .../go-github/{v65 => v66}/github/orgs.go | 0 .../github/orgs_actions_allowed.go | 0 .../github/orgs_actions_permissions.go | 0 .../go-github/v66/github/orgs_attestations.go | 40 + .../{v65 => v66}/github/orgs_audit_log.go | 0 .../orgs_codesecurity_configurations.go | 284 ++++ .../github/orgs_credential_authorizations.go | 12 +- .../github/orgs_custom_repository_roles.go | 131 ++ .../{v65 => v66}/github/orgs_hooks.go | 0 .../github/orgs_hooks_configuration.go | 0 .../github/orgs_hooks_deliveries.go | 0 .../{v65 => v66}/github/orgs_members.go | 16 +- .../github/orgs_organization_roles.go} | 140 +- .../github/orgs_outside_collaborators.go | 0 .../{v65 => v66}/github/orgs_packages.go | 0 .../github/orgs_personal_access_tokens.go | 0 .../{v65 => v66}/github/orgs_projects.go | 0 .../{v65 => v66}/github/orgs_properties.go | 5 +- .../{v65 => v66}/github/orgs_rules.go | 0 .../github/orgs_security_managers.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v65 => v66}/github/packages.go | 0 .../go-github/{v65 => v66}/github/projects.go | 0 .../go-github/{v65 => v66}/github/pulls.go | 3 +- .../{v65 => v66}/github/pulls_comments.go | 0 .../{v65 => v66}/github/pulls_reviewers.go | 22 +- .../{v65 => v66}/github/pulls_reviews.go | 0 .../{v65 => v66}/github/pulls_threads.go | 0 .../{v65 => v66}/github/rate_limit.go | 0 .../{v65 => v66}/github/reactions.go | 0 .../go-github/{v65 => v66}/github/repos.go | 8 +- .../github/repos_actions_access.go | 0 .../github/repos_actions_allowed.go | 0 .../github/repos_actions_permissions.go | 0 .../v66/github/repos_attestations.go | 39 + .../{v65 => v66}/github/repos_autolinks.go | 0 .../{v65 => v66}/github/repos_codeowners.go | 0 .../github/repos_collaborators.go | 0 .../{v65 => v66}/github/repos_comments.go | 0 .../{v65 => v66}/github/repos_commits.go | 0 .../github/repos_community_health.go | 0 .../{v65 => v66}/github/repos_contents.go | 2 +- .../repos_deployment_branch_policies.go | 0 .../repos_deployment_protection_rules.go | 0 .../{v65 => v66}/github/repos_deployments.go | 6 +- .../{v65 => v66}/github/repos_environments.go | 0 .../{v65 => v66}/github/repos_forks.go | 0 .../{v65 => v66}/github/repos_hooks.go | 0 .../github/repos_hooks_configuration.go | 0 .../github/repos_hooks_deliveries.go | 0 .../{v65 => v66}/github/repos_invitations.go | 1 + .../{v65 => v66}/github/repos_keys.go | 0 .../{v65 => v66}/github/repos_lfs.go | 0 .../{v65 => v66}/github/repos_merging.go | 0 .../{v65 => v66}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 8 +- .../{v65 => v66}/github/repos_projects.go | 0 .../{v65 => v66}/github/repos_properties.go | 0 .../{v65 => v66}/github/repos_releases.go | 0 .../{v65 => v66}/github/repos_rules.go | 342 +++- .../{v65 => v66}/github/repos_stats.go | 0 .../{v65 => v66}/github/repos_statuses.go | 0 .../{v65 => v66}/github/repos_tags.go | 15 +- .../{v65 => v66}/github/repos_traffic.go | 0 .../go-github/{v65 => v66}/github/scim.go | 0 .../go-github/{v65 => v66}/github/search.go | 2 +- .../{v65 => v66}/github/secret_scanning.go | 0 .../github/security_advisories.go | 0 .../go-github/{v65 => v66}/github/strings.go | 20 +- .../go-github/{v65 => v66}/github/teams.go | 65 +- .../github/teams_discussion_comments.go | 6 +- .../{v65 => v66}/github/teams_discussions.go | 2 +- .../{v65 => v66}/github/teams_members.go | 0 .../{v65 => v66}/github/timestamp.go | 2 +- .../go-github/{v65 => v66}/github/users.go | 4 +- .../github/users_administration.go | 8 +- .../v66/github/users_attestations.go | 40 + .../{v65 => v66}/github/users_blocking.go | 0 .../{v65 => v66}/github/users_emails.go | 6 +- .../{v65 => v66}/github/users_followers.go | 0 .../{v65 => v66}/github/users_gpg_keys.go | 2 +- .../{v65 => v66}/github/users_keys.go | 0 .../{v65 => v66}/github/users_packages.go | 0 .../{v65 => v66}/github/users_projects.go | 0 .../github/users_ssh_signing_keys.go | 0 .../{v65 => v66}/github/with_appengine.go | 1 - .../{v65 => v66}/github/without_appengine.go | 1 - vendor/modules.txt | 6 +- 289 files changed, 3027 insertions(+), 803 deletions(-) delete mode 100644 github/resource_github_repository_tag_protection.go delete mode 100644 github/resource_github_repository_tag_protection_test.go rename vendor/github.com/google/go-github/{v65 => v66}/AUTHORS (90%) rename vendor/github.com/google/go-github/{v65 => v66}/LICENSE (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_artifacts.go (93%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_cache.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_oidc.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_permissions_enterprise.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_permissions_orgs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_required_workflows.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_runner_groups.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_runners.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_secrets.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_variables.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_workflow_jobs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_workflow_runs.go (85%) rename vendor/github.com/google/go-github/{v65 => v66}/github/actions_workflows.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/activity_notifications.go (92%) rename vendor/github.com/google/go-github/{v65 => v66}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/admin.go (97%) rename vendor/github.com/google/go-github/{v65 => v66}/github/admin_orgs.go (93%) rename vendor/github.com/google/go-github/{v65 => v66}/github/admin_stats.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/admin_users.go (94%) rename vendor/github.com/google/go-github/{v65 => v66}/github/apps.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/apps_hooks.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/apps_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/apps_manifest.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/apps_marketplace.go (100%) create mode 100644 vendor/github.com/google/go-github/v66/github/attestations.go rename vendor/github.com/google/go-github/{v65 => v66}/github/authorizations.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/billing.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/checks.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/code-scanning.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/codesofconduct.go (95%) rename vendor/github.com/google/go-github/{v65 => v66}/github/codespaces.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/codespaces_secrets.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/copilot.go (62%) rename vendor/github.com/google/go-github/{v65 => v66}/github/dependabot.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/dependabot_alerts.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/dependabot_secrets.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/dependency_graph.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/dependency_graph_snapshots.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/doc.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/emojis.go (95%) rename vendor/github.com/google/go-github/{v65 => v66}/github/enterprise.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/enterprise_actions_runner_groups.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/enterprise_actions_runners.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/enterprise_audit_log.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/enterprise_code_security_and_analysis.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/event.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/event_types.go (94%) rename vendor/github.com/google/go-github/{v65 => v66}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/git.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/git_commits.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/github-accessors.go (95%) rename vendor/github.com/google/go-github/{v65 => v66}/github/github.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issue_import.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues_labels.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/markdown.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/messages.go (69%) rename vendor/github.com/google/go-github/{v65 => v66}/github/meta.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/migrations_source_import.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_actions_permissions.go (100%) create mode 100644 vendor/github.com/google/go-github/v66/github/orgs_attestations.go rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_audit_log.go (100%) create mode 100644 vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_credential_authorizations.go (83%) create mode 100644 vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_hooks_configuration.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_members.go (95%) rename vendor/github.com/google/go-github/{v65/github/orgs_custom_roles.go => v66/github/orgs_organization_roles.go} (62%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_packages.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_personal_access_tokens.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_properties.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_rules.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_security_managers.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/packages.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/projects.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/pulls.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/pulls_reviewers.go (76%) rename vendor/github.com/google/go-github/{v65 => v66}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/pulls_threads.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/rate_limit.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_actions_access.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_actions_permissions.go (100%) create mode 100644 vendor/github.com/google/go-github/v66/github/repos_attestations.go rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_autolinks.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_codeowners.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_commits.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_contents.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_deployment_branch_policies.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_deployment_protection_rules.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_deployments.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_environments.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_hooks.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_hooks_configuration.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_invitations.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_lfs.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_prereceive_hooks.go (93%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_properties.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_releases.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_rules.go (59%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_tags.go (62%) rename vendor/github.com/google/go-github/{v65 => v66}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/scim.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/search.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/secret_scanning.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/security_advisories.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/strings.go (85%) rename vendor/github.com/google/go-github/{v65 => v66}/github/teams.go (95%) rename vendor/github.com/google/go-github/{v65 => v66}/github/teams_discussion_comments.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/teams_discussions.go (99%) rename vendor/github.com/google/go-github/{v65 => v66}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/timestamp.go (95%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_administration.go (91%) create mode 100644 vendor/github.com/google/go-github/v66/github/users_attestations.go rename vendor/github.com/google/go-github/{v65 => v66}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_emails.go (94%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_gpg_keys.go (98%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_packages.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_projects.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/users_ssh_signing_keys.go (100%) rename vendor/github.com/google/go-github/{v65 => v66}/github/with_appengine.go (95%) rename vendor/github.com/google/go-github/{v65 => v66}/github/without_appengine.go (95%) diff --git a/github/config.go b/github/config.go index 536d70dc1b..b082fe6864 100644 --- a/github/config.go +++ b/github/config.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" diff --git a/github/data_source_github_actions_environment_secrets.go b/github/data_source_github_actions_environment_secrets.go index 0d0ed2e622..80b40c549c 100644 --- a/github/data_source_github_actions_environment_secrets.go +++ b/github/data_source_github_actions_environment_secrets.go @@ -5,7 +5,7 @@ import ( "fmt" "net/url" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_environment_variables.go b/github/data_source_github_actions_environment_variables.go index c8fe37fff6..1a161e5c56 100644 --- a/github/data_source_github_actions_environment_variables.go +++ b/github/data_source_github_actions_environment_variables.go @@ -5,7 +5,7 @@ import ( "fmt" "net/url" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_organization_secrets.go b/github/data_source_github_actions_organization_secrets.go index 22d8b9975b..6e1efd9119 100644 --- a/github/data_source_github_actions_organization_secrets.go +++ b/github/data_source_github_actions_organization_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_organization_variables.go b/github/data_source_github_actions_organization_variables.go index cb1bbf4fad..1b99598f30 100644 --- a/github/data_source_github_actions_organization_variables.go +++ b/github/data_source_github_actions_organization_variables.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_secrets.go b/github/data_source_github_actions_secrets.go index f13fe70513..8c719168b3 100644 --- a/github/data_source_github_actions_secrets.go +++ b/github/data_source_github_actions_secrets.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_actions_variables.go b/github/data_source_github_actions_variables.go index 478c2e17f0..0319e27454 100644 --- a/github/data_source_github_actions_variables.go +++ b/github/data_source_github_actions_variables.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_app_token_test.go b/github/data_source_github_app_token_test.go index 04bf4bd17c..d6a693eb53 100644 --- a/github/data_source_github_app_token_test.go +++ b/github/data_source_github_app_token_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/stretchr/testify/assert" ) diff --git a/github/data_source_github_branch.go b/github/data_source_github_branch.go index 6c860ed3f7..e8fc1c747d 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_codespaces_organization_secrets.go b/github/data_source_github_codespaces_organization_secrets.go index 31336f9ebf..be8c6c58a5 100644 --- a/github/data_source_github_codespaces_organization_secrets.go +++ b/github/data_source_github_codespaces_organization_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_codespaces_secrets.go b/github/data_source_github_codespaces_secrets.go index 40d6589f8c..51160c13dd 100644 --- a/github/data_source_github_codespaces_secrets.go +++ b/github/data_source_github_codespaces_secrets.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_codespaces_user_secrets.go b/github/data_source_github_codespaces_user_secrets.go index 60f199af75..567ed750c8 100644 --- a/github/data_source_github_codespaces_user_secrets.go +++ b/github/data_source_github_codespaces_user_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_collaborators.go b/github/data_source_github_collaborators.go index 8eab8c08b2..c381f25590 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/data_source_github_dependabot_organization_secrets.go b/github/data_source_github_dependabot_organization_secrets.go index 01c2598b7b..1c15acecb4 100644 --- a/github/data_source_github_dependabot_organization_secrets.go +++ b/github/data_source_github_dependabot_organization_secrets.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_dependabot_secrets.go b/github/data_source_github_dependabot_secrets.go index d5ca898892..6e5a614148 100644 --- a/github/data_source_github_dependabot_secrets.go +++ b/github/data_source_github_dependabot_secrets.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_external_groups.go b/github/data_source_github_external_groups.go index 73f9041b78..ac0833bb0f 100644 --- a/github/data_source_github_external_groups.go +++ b/github/data_source_github_external_groups.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_issue_labels.go b/github/data_source_github_issue_labels.go index 1535ceb38d..a17ee429c3 100644 --- a/github/data_source_github_issue_labels.go +++ b/github/data_source_github_issue_labels.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index 93fdc8723b..3869ff4ef5 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -3,7 +3,7 @@ package github import ( "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" ) diff --git a/github/data_source_github_organization_custom_role.go b/github/data_source_github_organization_custom_role.go index 72cc49ebcd..a2ae97ffeb 100644 --- a/github/data_source_github_organization_custom_role.go +++ b/github/data_source_github_organization_custom_role.go @@ -5,7 +5,7 @@ import ( "fmt" "log" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/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 a6affe3d0a..07c08b67e3 100644 --- a/github/data_source_github_organization_team_sync_groups.go +++ b/github/data_source_github_organization_team_sync_groups.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_organization_webhooks.go b/github/data_source_github_organization_webhooks.go index 19fba08194..46e039273e 100644 --- a/github/data_source_github_organization_webhooks.go +++ b/github/data_source_github_organization_webhooks.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_ref.go b/github/data_source_github_ref.go index ab2a1b12f0..dd148432ff 100644 --- a/github/data_source_github_ref.go +++ b/github/data_source_github_ref.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_release.go b/github/data_source_github_release.go index e3b52446dc..c7c95c396a 100644 --- a/github/data_source_github_release.go +++ b/github/data_source_github_release.go @@ -8,7 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repositories.go b/github/data_source_github_repositories.go index 663eb99560..38d56a5600 100644 --- a/github/data_source_github_repositories.go +++ b/github/data_source_github_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/data_source_github_repository.go b/github/data_source_github_repository.go index 925c6c1b2a..ed2a30143b 100644 --- a/github/data_source_github_repository.go +++ b/github/data_source_github_repository.go @@ -7,7 +7,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_autolink_references.go b/github/data_source_github_repository_autolink_references.go index 6ee2e05dae..3fd8136d9b 100644 --- a/github/data_source_github_repository_autolink_references.go +++ b/github/data_source_github_repository_autolink_references.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_branches.go b/github/data_source_github_repository_branches.go index 60c755acfa..91f527f2e1 100644 --- a/github/data_source_github_repository_branches.go +++ b/github/data_source_github_repository_branches.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_deploy_keys.go b/github/data_source_github_repository_deploy_keys.go index 52e15dde26..df23755860 100644 --- a/github/data_source_github_repository_deploy_keys.go +++ b/github/data_source_github_repository_deploy_keys.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_environments.go b/github/data_source_github_repository_environments.go index a68147db90..13e5dd8465 100644 --- a/github/data_source_github_repository_environments.go +++ b/github/data_source_github_repository_environments.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_file.go b/github/data_source_github_repository_file.go index 79b7ab93cb..27f9f5ceed 100644 --- a/github/data_source_github_repository_file.go +++ b/github/data_source_github_repository_file.go @@ -8,7 +8,7 @@ import ( "net/url" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_file_test.go b/github/data_source_github_repository_file_test.go index 41f8d161d6..c4b3005a59 100644 --- a/github/data_source_github_repository_file_test.go +++ b/github/data_source_github_repository_file_test.go @@ -9,7 +9,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/stretchr/testify/assert" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" diff --git a/github/data_source_github_repository_pull_requests.go b/github/data_source_github_repository_pull_requests.go index e7ac9c4eff..c7053ddc52 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/data_source_github_repository_teams.go b/github/data_source_github_repository_teams.go index 03ce9a06e9..0354ae13e6 100644 --- a/github/data_source_github_repository_teams.go +++ b/github/data_source_github_repository_teams.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_repository_webhooks.go b/github/data_source_github_repository_webhooks.go index 450b45d159..2b0b248504 100644 --- a/github/data_source_github_repository_webhooks.go +++ b/github/data_source_github_repository_webhooks.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index 4e5f534175..ea1ca66c39 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -4,7 +4,7 @@ import ( "context" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/shurcooL/githubv4" diff --git a/github/provider.go b/github/provider.go index 39741a2c1d..a9a04d0474 100644 --- a/github/provider.go +++ b/github/provider.go @@ -181,7 +181,6 @@ func Provider() *schema.Provider { "github_repository_project": resourceGithubRepositoryProject(), "github_repository_pull_request": resourceGithubRepositoryPullRequest(), "github_repository_ruleset": resourceGithubRepositoryRuleset(), - "github_repository_tag_protection": resourceGithubRepositoryTagProtection(), "github_repository_topics": resourceGithubRepositoryTopics(), "github_repository_webhook": resourceGithubRepositoryWebhook(), "github_team": resourceGithubTeam(), diff --git a/github/repository_utils.go b/github/repository_utils.go index eba144b10a..7086a7b25a 100644 --- a/github/repository_utils.go +++ b/github/repository_utils.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/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 d1568a567a..1558084996 100644 --- a/github/resource_github_actions_environment_secret.go +++ b/github/resource_github_actions_environment_secret.go @@ -7,7 +7,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_environment_variable.go b/github/resource_github_actions_environment_variable.go index 5cd198f42b..a4b8132fdc 100644 --- a/github/resource_github_actions_environment_variable.go +++ b/github/resource_github_actions_environment_variable.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go b/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go index ab9399ea9f..c4983efd9e 100644 --- a/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go +++ b/github/resource_github_actions_organization_oidc_subject_claim_customization_template.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_organization_permissions.go b/github/resource_github_actions_organization_permissions.go index c5dafe66ee..9f5174d8b3 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret.go b/github/resource_github_actions_organization_secret.go index 182b911b55..4c196f218d 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_organization_secret_repositories.go b/github/resource_github_actions_organization_secret_repositories.go index 99e08cc464..5328ffefee 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_organization_variable.go b/github/resource_github_actions_organization_variable.go index ebe6921b2d..2de03600d4 100644 --- a/github/resource_github_actions_organization_variable.go +++ b/github/resource_github_actions_organization_variable.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_actions_repository_access_level.go b/github/resource_github_actions_repository_access_level.go index 98074d30e2..a6a8d72ceb 100644 --- a/github/resource_github_actions_repository_access_level.go +++ b/github/resource_github_actions_repository_access_level.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go b/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go index 289e5e9a61..803739abe1 100644 --- a/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go +++ b/github/resource_github_actions_repository_oidc_subject_claim_customization_template.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_repository_permissions.go b/github/resource_github_actions_repository_permissions.go index db7588ab74..c55ea7d289 100644 --- a/github/resource_github_actions_repository_permissions.go +++ b/github/resource_github_actions_repository_permissions.go @@ -4,7 +4,7 @@ import ( "context" "log" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_runner_group.go b/github/resource_github_actions_runner_group.go index aad3319498..0675429ea3 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_actions_secret.go b/github/resource_github_actions_secret.go index 791806fa12..79fea4f729 100644 --- a/github/resource_github_actions_secret.go +++ b/github/resource_github_actions_secret.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "golang.org/x/crypto/nacl/box" ) diff --git a/github/resource_github_actions_variable.go b/github/resource_github_actions_variable.go index 334bb241a7..e8fa5c44a6 100644 --- a/github/resource_github_actions_variable.go +++ b/github/resource_github_actions_variable.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_app_installation_repositories.go b/github/resource_github_app_installation_repositories.go index ab8cad41b3..b84aa6eaa5 100644 --- a/github/resource_github_app_installation_repositories.go +++ b/github/resource_github_app_installation_repositories.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_app_installation_repository.go b/github/resource_github_app_installation_repository.go index 758803ac86..5b3ec71b1b 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_branch.go b/github/resource_github_branch.go index 97979dc67e..8e28c40588 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_branch_default.go b/github/resource_github_branch_default.go index 91df5694f9..27781d275d 100644 --- a/github/resource_github_branch_default.go +++ b/github/resource_github_branch_default.go @@ -5,7 +5,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_branch_protection_v3.go b/github/resource_github_branch_protection_v3.go index 89624a1ecc..9c4942d473 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_branch_protection_v3_utils.go b/github/resource_github_branch_protection_v3_utils.go index 686f9a449f..94f2ae8242 100644 --- a/github/resource_github_branch_protection_v3_utils.go +++ b/github/resource_github_branch_protection_v3_utils.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_codespaces_organization_secret.go b/github/resource_github_codespaces_organization_secret.go index 640619c5ab..95e997a330 100644 --- a/github/resource_github_codespaces_organization_secret.go +++ b/github/resource_github_codespaces_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_codespaces_organization_secret_repositories.go b/github/resource_github_codespaces_organization_secret_repositories.go index 39467cc61d..2712dbe330 100644 --- a/github/resource_github_codespaces_organization_secret_repositories.go +++ b/github/resource_github_codespaces_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_codespaces_secret.go b/github/resource_github_codespaces_secret.go index 19078cc5c2..0090bb970c 100644 --- a/github/resource_github_codespaces_secret.go +++ b/github/resource_github_codespaces_secret.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_codespaces_user_secret.go b/github/resource_github_codespaces_user_secret.go index 45a6c35e0f..dd0fde57ca 100644 --- a/github/resource_github_codespaces_user_secret.go +++ b/github/resource_github_codespaces_user_secret.go @@ -6,7 +6,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_dependabot_organization_secret.go b/github/resource_github_dependabot_organization_secret.go index 2a696027c0..66d751a313 100644 --- a/github/resource_github_dependabot_organization_secret.go +++ b/github/resource_github_dependabot_organization_secret.go @@ -7,7 +7,7 @@ import ( "log" "net/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_dependabot_organization_secret_repositories.go b/github/resource_github_dependabot_organization_secret_repositories.go index d9bc5899b7..c70fd9d189 100644 --- a/github/resource_github_dependabot_organization_secret_repositories.go +++ b/github/resource_github_dependabot_organization_secret_repositories.go @@ -3,7 +3,7 @@ package github import ( "context" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_dependabot_secret.go b/github/resource_github_dependabot_secret.go index 203b2a46df..f2bc973aa4 100644 --- a/github/resource_github_dependabot_secret.go +++ b/github/resource_github_dependabot_secret.go @@ -8,7 +8,7 @@ import ( "net/http" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "golang.org/x/crypto/nacl/box" ) diff --git a/github/resource_github_emu_group_mapping.go b/github/resource_github_emu_group_mapping.go index bc152c1962..f361e6fcad 100644 --- a/github/resource_github_emu_group_mapping.go +++ b/github/resource_github_emu_group_mapping.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_enterprise_actions_permissions.go b/github/resource_github_enterprise_actions_permissions.go index 337db3a976..7a7a78fcc1 100644 --- a/github/resource_github_enterprise_actions_permissions.go +++ b/github/resource_github_enterprise_actions_permissions.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_enterprise_actions_runner_group.go b/github/resource_github_enterprise_actions_runner_group.go index 96973a37c7..a8350f7339 100644 --- a/github/resource_github_enterprise_actions_runner_group.go +++ b/github/resource_github_enterprise_actions_runner_group.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_enterprise_organization.go b/github/resource_github_enterprise_organization.go index 864869b2c9..041fdf1926 100644 --- a/github/resource_github_enterprise_organization.go +++ b/github/resource_github_enterprise_organization.go @@ -6,7 +6,7 @@ import ( "log" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" ) diff --git a/github/resource_github_issue.go b/github/resource_github_issue.go index 8b669f07a0..74811ba103 100644 --- a/github/resource_github_issue.go +++ b/github/resource_github_issue.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_issue_label.go b/github/resource_github_issue_label.go index d368a70bc5..47b5c7bc1a 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_issue_labels.go b/github/resource_github_issue_labels.go index 93d2919652..4351b40328 100644 --- a/github/resource_github_issue_labels.go +++ b/github/resource_github_issue_labels.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_membership.go b/github/resource_github_membership.go index 605798f76b..de8f8addbb 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_membership_test.go b/github/resource_github_membership_test.go index 179743d2d6..33064f89b7 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) diff --git a/github/resource_github_organization_custom_role.go b/github/resource_github_organization_custom_role.go index 12ae72ec73..8bed03804d 100644 --- a/github/resource_github_organization_custom_role.go +++ b/github/resource_github_organization_custom_role.go @@ -6,7 +6,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_organization_project.go b/github/resource_github_organization_project.go index 2414a31d11..9e4aa15e73 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_organization_project_test.go b/github/resource_github_organization_project_test.go index a65daf6bae..f8e9e9eb42 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) diff --git a/github/resource_github_organization_ruleset.go b/github/resource_github_organization_ruleset.go index 8831f70f5b..8495dca389 100644 --- a/github/resource_github_organization_ruleset.go +++ b/github/resource_github_organization_ruleset.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_organization_security_manager.go b/github/resource_github_organization_security_manager.go index ed39728975..54d86227f3 100644 --- a/github/resource_github_organization_security_manager.go +++ b/github/resource_github_organization_security_manager.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_organization_settings.go b/github/resource_github_organization_settings.go index db7d62a6da..1af2b56e33 100644 --- a/github/resource_github_organization_settings.go +++ b/github/resource_github_organization_settings.go @@ -5,7 +5,7 @@ import ( "log" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_organization_webhook.go b/github/resource_github_organization_webhook.go index 55b6cc61a3..e263fca001 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_project_card.go b/github/resource_github_project_card.go index 95f2552516..8b6dfec17c 100644 --- a/github/resource_github_project_card.go +++ b/github/resource_github_project_card.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_project_column.go b/github/resource_github_project_column.go index 72bf1c986f..fa54106fe2 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_project_column_test.go b/github/resource_github_project_column_test.go index adcaceef4b..bc2e0dc75d 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) diff --git a/github/resource_github_release.go b/github/resource_github_release.go index d5f01f19c3..c70431d3ae 100644 --- a/github/resource_github_release.go +++ b/github/resource_github_release.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository.go b/github/resource_github_repository.go index cc3c3a129d..f28cc4c6e8 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_autolink_reference.go b/github/resource_github_repository_autolink_reference.go index 27e12a036a..e249e19550 100644 --- a/github/resource_github_repository_autolink_reference.go +++ b/github/resource_github_repository_autolink_reference.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_collaborator.go b/github/resource_github_repository_collaborator.go index 096b514e64..b8e798805d 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_collaborators.go b/github/resource_github_repository_collaborators.go index cc04f6fc6e..dc2cbcddc8 100644 --- a/github/resource_github_repository_collaborators.go +++ b/github/resource_github_repository_collaborators.go @@ -8,7 +8,7 @@ import ( "sort" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_collaborators_test.go b/github/resource_github_repository_collaborators_test.go index 1fa17ae5ef..4e4d60ae12 100644 --- a/github/resource_github_repository_collaborators_test.go +++ b/github/resource_github_repository_collaborators_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/github/resource_github_repository_deploy_key.go b/github/resource_github_repository_deploy_key.go index ef21272319..4d970711fb 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_deployment_branch_policy.go b/github/resource_github_repository_deployment_branch_policy.go index 1c504e18f1..6957d63067 100644 --- a/github/resource_github_repository_deployment_branch_policy.go +++ b/github/resource_github_repository_deployment_branch_policy.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_environment.go b/github/resource_github_repository_environment.go index ff5cd5a892..305087257b 100644 --- a/github/resource_github_repository_environment.go +++ b/github/resource_github_repository_environment.go @@ -6,7 +6,7 @@ import ( "net/http" "net/url" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_environment_deployment_policy.go b/github/resource_github_repository_environment_deployment_policy.go index 598ecdbf2a..c74d8ea9c5 100644 --- a/github/resource_github_repository_environment_deployment_policy.go +++ b/github/resource_github_repository_environment_deployment_policy.go @@ -7,7 +7,7 @@ import ( "net/url" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_file.go b/github/resource_github_repository_file.go index 4892cf73ac..c84a8a1953 100644 --- a/github/resource_github_repository_file.go +++ b/github/resource_github_repository_file.go @@ -10,7 +10,7 @@ import ( "fmt" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_milestone.go b/github/resource_github_repository_milestone.go index f8c0b6184a..f4e72798b2 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_project.go b/github/resource_github_repository_project.go index 2c1d09d3cf..278900c7fe 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_pull_request.go b/github/resource_github_repository_pull_request.go index 249cd5d3e4..385824a5cd 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_repository_ruleset.go b/github/resource_github_repository_ruleset.go index 2eb1270614..cb5c7053e3 100644 --- a/github/resource_github_repository_ruleset.go +++ b/github/resource_github_repository_ruleset.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_tag_protection.go b/github/resource_github_repository_tag_protection.go deleted file mode 100644 index de0bf2aeeb..0000000000 --- a/github/resource_github_repository_tag_protection.go +++ /dev/null @@ -1,130 +0,0 @@ -package github - -import ( - "context" - "fmt" - "log" - "net/http" - "strconv" - "strings" - - "github.com/google/go-github/v65/github" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" -) - -func resourceGithubRepositoryTagProtection() *schema.Resource { - return &schema.Resource{ - Create: resourceGithubRepositoryTagProtectionCreateOrUpdate, - Read: resourceGithubRepositoryTagProtectionRead, - Delete: resourceGithubRepositoryTagProtectionDelete, - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - parts := strings.Split(d.Id(), "/") - if len(parts) != 2 { - return nil, fmt.Errorf("invalid ID specified: supplied ID must be written as /") - } - if err := d.Set("repository", parts[0]); err != nil { - return nil, err - } - tag_protection_id, err := strconv.ParseInt(parts[1], 10, 64) - if err != nil { - return nil, err - } - if err := d.Set("tag_protection_id", tag_protection_id); err != nil { - return nil, err - } - d.SetId(parts[1]) - return []*schema.ResourceData{d}, nil - }, - }, - - Schema: map[string]*schema.Schema{ - "repository": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "Name of the repository to add the tag protection to.", - }, - "pattern": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Description: "The pattern of the tag to protect.", - }, - "tag_protection_id": { - Type: schema.TypeInt, - Computed: true, - Description: "The ID of the tag protection.", - }, - }, - } -} - -func resourceGithubRepositoryTagProtectionCreateOrUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*Owner).v3client - ctx := context.Background() - owner := meta.(*Owner).name - repo := d.Get("repository").(string) - pattern := d.Get("pattern").(string) - log.Printf("[DEBUG] Creating tag protection for %s/%s with pattern %s", owner, repo, pattern) - tagProtection, _, err := client.Repositories.CreateTagProtection(ctx, owner, repo, pattern) - if err != nil { - return err - } - d.SetId(strconv.FormatInt(tagProtection.GetID(), 10)) - - return resourceGithubRepositoryTagProtectionRead(d, meta) -} - -func resourceGithubRepositoryTagProtectionRead(d *schema.ResourceData, meta interface{}) error { - - ctx := context.WithValue(context.Background(), ctxId, d.Id()) - - client := meta.(*Owner).v3client - owner := meta.(*Owner).name - repo := d.Get("repository").(string) - - id, err := strconv.ParseInt(d.Id(), 10, 64) - if err != nil { - return err - } - - tag_protection, _, err := client.Repositories.ListTagProtection(ctx, owner, repo) - if err != nil { - if ghErr, ok := err.(*github.ErrorResponse); ok { - if ghErr.Response.StatusCode == http.StatusNotModified { - return nil - } - if ghErr.Response.StatusCode == http.StatusNotFound && d.IsNewResource() { - return nil - } - return err - } - return err - } - for _, tag := range tag_protection { - if tag.GetID() == id { - if err = d.Set("pattern", tag.GetPattern()); err != nil { - return err - } - } - } - - return nil -} - -func resourceGithubRepositoryTagProtectionDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*Owner).v3client - ctx := context.WithValue(context.Background(), ctxId, d.Id()) - owner := meta.(*Owner).name - repo := d.Get("repository").(string) - tag_protection_id, err := strconv.ParseInt(d.Id(), 10, 64) - if err != nil { - return err - } - - log.Printf("[DEBUG] Deleting tag protection for %s/%s with id %d", owner, repo, tag_protection_id) - _, error := client.Repositories.DeleteTagProtection(ctx, owner, repo, tag_protection_id) - - return error -} diff --git a/github/resource_github_repository_tag_protection_test.go b/github/resource_github_repository_tag_protection_test.go deleted file mode 100644 index 106d02e1fe..0000000000 --- a/github/resource_github_repository_tag_protection_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package github - -import ( - "fmt" - "testing" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -// TODO: This still failes on mismatched ID on stateVerify -func TestAccGithubRepositoryTagProtection(t *testing.T) { - t.Run("creates tag protection without error", func(t *testing.T) { - randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) - - config := fmt.Sprintf(` - resource "github_repository" "test" { - name = "tf-acc-test-%s" - auto_init = true - visibility = "private" - } - - resource "github_repository_tag_protection" "test" { - depends_on = ["github_repository.test"] - repository = github_repository.test.name - pattern = "v*" - } - `, randomID) - - check := resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - "github_repository_tag_protection.test", "pattern", "v*", - ), - ) - - testCase := func(t *testing.T, mode string) { - resource.Test(t, resource.TestCase{ - PreCheck: func() { skipUnlessMode(t, mode) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: config, - Check: check, - }, - }, - }) - } - t.Run("run with an anonymous account", func(t *testing.T) { - t.Skip("anonymous account not supported for this operation") - }) - t.Run("run with an individual account", func(t *testing.T) { - testCase(t, individual) - }) - t.Run("run with an organization account", func(t *testing.T) { - testCase(t, organization) - }) - - }) - t.Run("imports tag protection without error", func(t *testing.T) { - randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) - - config := fmt.Sprintf(` - resource "github_repository" "test" { - name = "tf-acc-test-%s" - auto_init = true - visibility = "private" - } - - resource "github_repository_tag_protection" "test" { - depends_on = ["github_repository.test"] - repository = github_repository.test.name - pattern = "v*" - } - `, randomID) - - check := resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - "github_repository_tag_protection.test", "pattern", "v*", - ), - resource.TestCheckResourceAttrSet( - "github_repository_tag_protection.test", "id", - ), - ) - - testCase := func(t *testing.T, mode string) { - resource.Test(t, resource.TestCase{ - PreCheck: func() { skipUnlessMode(t, mode) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: config, - Check: check, - }, - { - ResourceName: "github_repository_tag_protection.test", - ImportState: true, - ImportStateIdPrefix: fmt.Sprintf("tf-acc-test-%s/", randomID), - ImportStateVerify: true, - }, - }, - }) - } - t.Run("run with an anonymous account", func(t *testing.T) { - t.Skip("anonymous account not supported for this operation") - }) - t.Run("run with an individual account", func(t *testing.T) { - testCase(t, individual) - }) - t.Run("run with an organization account", func(t *testing.T) { - testCase(t, organization) - }) - }) - t.Run("deletes tag protection without error", func(t *testing.T) { - randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) - - config := fmt.Sprintf(` - resource "github_repository" "test" { - name = "tf-acc-test-%s" - auto_init = true - visibility = "private" - } - - resource "github_repository_tag_protection" "test" { - depends_on = ["github_repository.test"] - repository = github_repository.test.name - pattern = "v*" - } - `, randomID) - - testCase := func(t *testing.T, mode string) { - resource.Test(t, resource.TestCase{ - PreCheck: func() { skipUnlessMode(t, mode) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: config, - Destroy: true, - }, - }, - }) - } - - t.Run("run with an anonymous account", func(t *testing.T) { - t.Skip("anonymous account not supported for this operation") - }) - - t.Run("run with an individual account", func(t *testing.T) { - testCase(t, individual) - }) - - t.Run("run with an organization account", func(t *testing.T) { - testCase(t, organization) - }) - - }) - -} diff --git a/github/resource_github_repository_topics.go b/github/resource_github_repository_topics.go index 41708ac5da..e8cee9a68b 100644 --- a/github/resource_github_repository_topics.go +++ b/github/resource_github_repository_topics.go @@ -6,7 +6,7 @@ import ( "net/http" "regexp" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) diff --git a/github/resource_github_repository_webhook.go b/github/resource_github_repository_webhook.go index c0eba0d176..a6c516d439 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team.go b/github/resource_github_team.go index 9943e1c34c..d862540afd 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" diff --git a/github/resource_github_team_members.go b/github/resource_github_team_members.go index 290b2b3d79..54c39eb0cf 100644 --- a/github/resource_github_team_members.go +++ b/github/resource_github_team_members.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/githubv4" ) diff --git a/github/resource_github_team_members_test.go b/github/resource_github_team_members_test.go index 0fbba16f99..fc9a1ff568 100644 --- a/github/resource_github_team_members_test.go +++ b/github/resource_github_team_members_test.go @@ -6,7 +6,7 @@ import ( "strconv" "testing" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/github/resource_github_team_membership.go b/github/resource_github_team_membership.go index a3d953ca83..6001c2fca3 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team_membership_test.go b/github/resource_github_team_membership_test.go index d0594e1663..13c113722e 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/github/resource_github_team_repository.go b/github/resource_github_team_repository.go index adac093d3c..65aeff843d 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_team_sync_group_mapping.go b/github/resource_github_team_sync_group_mapping.go index e52b886cb6..e9a4482df6 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/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 b460757576..a0488f2080 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" diff --git a/github/resource_github_user_gpg_key.go b/github/resource_github_user_gpg_key.go index f44041dd1c..ba9c0adb4c 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_github_user_ssh_key.go b/github/resource_github_user_ssh_key.go index 62bbf37dba..7e196ab234 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/resource_organization_block.go b/github/resource_organization_block.go index a22b2d020b..33bfe0f7ed 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/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/respository_rules_utils.go b/github/respository_rules_utils.go index 7a42c6feb8..7956308678 100644 --- a/github/respository_rules_utils.go +++ b/github/respository_rules_utils.go @@ -6,7 +6,7 @@ import ( "reflect" "sort" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) diff --git a/github/transport.go b/github/transport.go index 94096f8e31..d091fc01bd 100644 --- a/github/transport.go +++ b/github/transport.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) const ( diff --git a/github/transport_test.go b/github/transport_test.go index b8741a5132..47b6fd257e 100644 --- a/github/transport_test.go +++ b/github/transport_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" ) func TestEtagTransport(t *testing.T) { diff --git a/github/util.go b/github/util.go index df879255d2..321a201fb4 100644 --- a/github/util.go +++ b/github/util.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/hashicorp/go-cty/cty" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/go.mod b/go.mod index cad7c78b36..c313d34453 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/client9/misspell v0.3.4 github.com/go-jose/go-jose/v3 v3.0.3 github.com/golangci/golangci-lint v1.59.1 - github.com/google/go-github/v65 v65.0.0 + github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 github.com/google/uuid v1.6.0 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 diff --git a/go.sum b/go.sum index 846603e138..93d5430c2f 100644 --- a/go.sum +++ b/go.sum @@ -290,8 +290,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v65 v65.0.0 h1:pQ7BmO3DZivvFk92geC0jB0q2m3gyn8vnYPgV7GSLhQ= -github.com/google/go-github/v65 v65.0.0/go.mod h1:DvrqWo5hvsdhJvHd4WyVF9ttANN3BniqjP8uTFMNb60= +github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 h1:Ne77zoI0NHPnZ/GPRzTVsedUUrkrI2UcnS821dfqp28= +github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= 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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/vendor/github.com/google/go-github/v65/AUTHORS b/vendor/github.com/google/go-github/v66/AUTHORS similarity index 90% rename from vendor/github.com/google/go-github/v65/AUTHORS rename to vendor/github.com/google/go-github/v66/AUTHORS index 075ba8dfa3..d211645098 100644 --- a/vendor/github.com/google/go-github/v65/AUTHORS +++ b/vendor/github.com/google/go-github/v66/AUTHORS @@ -13,7 +13,10 @@ 413x 6543 <6543@obermui.de> Abed Kibbe +Abhijit Hota Abhinav Gupta +abhishek +Abhishek Sharma Abhishek Veeramalla aboy Adam Kohring @@ -35,19 +38,24 @@ Alex Orr Alex Su Alex Unger Alexander Harkness +Alexey Alekhin Alexis Gauthiez Ali Farooq +Alin Balutoiu Allan Guwatudde Allen Sun Amey Sakhadeo Anders Janmyr +Andreas Deininger Andreas Garnæs Andrew Ryabchun Andrew Svoboda +Andriyun Andy Grunwald Andy Hume Andy Lindeman angie pinilla +Anish Rajan anjanashenoy Anshuman Bhartiya Antoine @@ -59,6 +67,7 @@ aprp apurwaj2 Aravind Arda Kuyumcu +Ary Arıl Bozoluk Asier Marruedo Austin Burdine @@ -66,9 +75,11 @@ Austin Dizzy Azuka Okuleye Ben Batha Benjamen Keroack +Benjamin Nater Berkay Tacyildiz Beshr Kayali Beyang Liu +billnapier Billy Keyes Billy Lynch Bingtan Lu @@ -93,6 +104,7 @@ Cami Diez Carl Johnson Carlos Alexandro Becker Carlos Tadeu Panato Junior +Casey ChandanChainani chandresh-pancholi Charles Fenwick Elliott @@ -109,6 +121,7 @@ Christian Muehlhaeuser Christoph Jerolimov Christoph Sassenberg CI Monk +Clemens W Colin Misare Craig Gumbley Craig Peterson @@ -137,6 +150,7 @@ DeviousLab Dhi Aurrahman Diego Lapiduz Diogo Vilela +Dion Gionet Mallet Dmitri Shuralyov dmnlk Don Petersen @@ -149,9 +163,12 @@ Eli Uriegas Elliott Beach Emerson Wood Emil V +Emma Sax Eng Zer Jun +Enrico Candino eperm Erick Fejta +Erik Elkins Erik Nobel erwinvaneyk Evan Anderson @@ -163,6 +180,7 @@ Federico Di Pierro Felix Geisendörfer Filippo Valsorda Florian Forster +Florian Maier Florian Wagner Francesc Gil Francis @@ -178,6 +196,7 @@ Glen Mailer Gnahz Google Inc. Grachev Mikhail +Gregory Oschwald griffin_stewie guangwu Guillaume Jacquet @@ -202,6 +221,7 @@ ishan upadhyay isqua Jacob Valdemar Jake Krammer +Jake Scaltreto Jake White Jameel Haffejee James Bowes @@ -210,6 +230,7 @@ James Loh James Maguire James Turley Jamie West +Jan Guth Jan Kosecki Jan Å vábík Jason Field @@ -224,6 +245,7 @@ Jihoon Chung Jille Timmermans Jimmi Dyson Joan Saum +JoannaaKL Joe Tsai John Barton John Engelman @@ -232,6 +254,7 @@ John Liu Jordan Brockopp Jordan Burandt Jordan Sussman +Jorge Ferrero Jorge Gómez Reus Joshua Bezaleel Abednego João Cerqueira @@ -240,6 +263,7 @@ jpbelanger-mtl Juan Juan Basso Julien Garcia Gonzalez +Julien Midedji Julien Rostand Junya Kono Justin Abrahms @@ -257,6 +281,7 @@ Kevin Burke Kevin Wang Kevin Zhao kgalli +Khanh Ngo Kirill Konrad Malawski Kookheon Kwon @@ -266,10 +291,12 @@ Kshitij Saraogi Kumar Saurabh Kyle Kurz kyokomi +Lachlan Cooper Lars Lehtonen Laurent Verdoïa leopoldwang Liam Galvin +Liam Stanley Lluis Campos Lovro Mažgon Loïs Postula @@ -283,6 +310,8 @@ Luke Kysow Luke Roberts Luke Young lynn [they] +Léo Salé +M. Ryan Rigdon Magnus Kulke Maksim Zhylinski Marc Binder @@ -294,6 +323,7 @@ Martins Sipenko Marwan Sulaiman Masayuki Izumi Mat Geist +Matheus Santos Araújo Matija Horvat Matin Rahmanian Matt @@ -301,6 +331,7 @@ Matt Brender Matt Dainty Matt Gaunt Matt Landis +Matt Mencel Matt Moore Matt Simons Matthew Reidy @@ -312,8 +343,11 @@ MichaÅ‚ Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +Mishin Nikolai mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili +Mohammed Nafees +Mudit Mukundan Senthil Munia Balayil Mustafa Abban @@ -321,16 +355,20 @@ Nadav Kaner Naoki Kanatani Nathan VanBenschoten Navaneeth Suresh +Nayeem Hasan Neal Caffery Neil O'Toole +Nicholas Herring Nick Miyake Nick Platt Nick Spragg Nicolas Chapurlat Nikhita Raghunath +Nikita Pivkin Nilesh Singh Noah Hanjun Lee Noah Zoschke +Noble Varghese ns-cweber nxya Ole Orhagen @@ -358,6 +396,7 @@ Pierce McEntagart Pierre Carrier Piotr Zurek Piyush Chugh +Pj Meyer Pratik Mallya Qais Patankar Quang Le Hong @@ -370,6 +409,7 @@ Rafael Aramizu Gomes Rajat Jindal Rajendra arora Rajkumar +Ramesh Gaikwad Ranbir Singh Ravi Shekhar Jethani RaviTeja Pothana @@ -379,18 +419,23 @@ Reetuparna Mukherjee reeves122 Reinier Timmer Renjith R +Rez Moss +Riaje Ricco Førgaard Richard de Vries Rob Figueiredo Rohit Upadhyay Rojan Dinc +Roming22 Ronak Jain Ronan Pelliard Ross Gustafson Ruben Vereecken +Rufina Talalaeva Russell Boley Ryan Leung Ryan Lower +Ryan Skidmore Ryo Nakao Saaarah Safwan Olaimat @@ -452,6 +497,9 @@ Tingluo Huang tkhandel Tobias Gesellchen Tom Payne +Tomasz Adam Skrzypczak +tomfeigin +Travis Tomsu Trey Tacon tsbkw ttacon @@ -483,7 +531,8 @@ Yurii Soldak Yusef Mohamadi Yusuke Kuoka Zach Latta +Ze Peng zhouhaibing089 六开箱 缘生 -蒋航 \ No newline at end of file +蒋航 diff --git a/vendor/github.com/google/go-github/v65/LICENSE b/vendor/github.com/google/go-github/v66/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v65/LICENSE rename to vendor/github.com/google/go-github/v66/LICENSE diff --git a/vendor/github.com/google/go-github/v65/github/actions.go b/vendor/github.com/google/go-github/v66/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions.go rename to vendor/github.com/google/go-github/v66/github/actions.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_artifacts.go b/vendor/github.com/google/go-github/v66/github/actions_artifacts.go similarity index 93% rename from vendor/github.com/google/go-github/v65/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v66/github/actions_artifacts.go index f804b809b4..e05a9a8402 100644 --- a/vendor/github.com/google/go-github/v65/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v66/github/actions_artifacts.go @@ -50,12 +50,22 @@ type ArtifactList struct { Artifacts []*Artifact `json:"artifacts,omitempty"` } +// ListArtifactsOptions specifies the optional parameters to the +// ActionsService.ListArtifacts method. +type ListArtifactsOptions struct { + // Name represents the name field of an artifact. + // When specified, only artifacts with this name will be returned. + Name *string `url:"name,omitempty"` + + ListOptions +} + // ListArtifacts lists all artifacts that belong to a repository. // // GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/artifacts -func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListOptions) (*ArtifactList, *Response, error) { +func (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListArtifactsOptions) (*ArtifactList, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts", owner, repo) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v65/github/actions_cache.go b/vendor/github.com/google/go-github/v66/github/actions_cache.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/actions_cache.go rename to vendor/github.com/google/go-github/v66/github/actions_cache.go index 271d7d8206..852e9860f1 100644 --- a/vendor/github.com/google/go-github/v65/github/actions_cache.go +++ b/vendor/github.com/google/go-github/v66/github/actions_cache.go @@ -173,7 +173,7 @@ func (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo s // refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. // // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. -// GitHub Apps must have the organization_admistration:read permission to use this endpoint. +// GitHub Apps must have the organization_administration:read permission to use this endpoint. // // GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization // @@ -203,7 +203,7 @@ func (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org str // 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. // // Permissions: You must authenticate using an access token with the read:org scope to use this endpoint. -// GitHub Apps must have the organization_admistration:read permission to use this endpoint. +// GitHub Apps must have the organization_administration:read permission to use this endpoint. // // GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization // diff --git a/vendor/github.com/google/go-github/v65/github/actions_oidc.go b/vendor/github.com/google/go-github/v66/github/actions_oidc.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_oidc.go rename to vendor/github.com/google/go-github/v66/github/actions_oidc.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_permissions_enterprise.go b/vendor/github.com/google/go-github/v66/github/actions_permissions_enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_permissions_enterprise.go rename to vendor/github.com/google/go-github/v66/github/actions_permissions_enterprise.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_permissions_orgs.go b/vendor/github.com/google/go-github/v66/github/actions_permissions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_permissions_orgs.go rename to vendor/github.com/google/go-github/v66/github/actions_permissions_orgs.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_required_workflows.go b/vendor/github.com/google/go-github/v66/github/actions_required_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_required_workflows.go rename to vendor/github.com/google/go-github/v66/github/actions_required_workflows.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v66/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v66/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_runners.go b/vendor/github.com/google/go-github/v66/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_runners.go rename to vendor/github.com/google/go-github/v66/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_secrets.go b/vendor/github.com/google/go-github/v66/github/actions_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_secrets.go rename to vendor/github.com/google/go-github/v66/github/actions_secrets.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_variables.go b/vendor/github.com/google/go-github/v66/github/actions_variables.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_variables.go rename to vendor/github.com/google/go-github/v66/github/actions_variables.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v66/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v66/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v65/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v66/github/actions_workflow_runs.go similarity index 85% rename from vendor/github.com/google/go-github/v65/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v66/github/actions_workflow_runs.go index d55c01dcd7..122ea1d0e2 100644 --- a/vendor/github.com/google/go-github/v65/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v66/github/actions_workflow_runs.go @@ -112,6 +112,31 @@ type ReferencedWorkflow struct { Ref *string `json:"ref,omitempty"` } +// PendingDeployment represents the pending_deployments response. +type PendingDeployment struct { + Environment *PendingDeploymentEnvironment `json:"environment,omitempty"` + WaitTimer *int64 `json:"wait_timer,omitempty"` + WaitTimerStartedAt *Timestamp `json:"wait_timer_started_at,omitempty"` + CurrentUserCanApprove *bool `json:"current_user_can_approve,omitempty"` + Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` +} + +// PendingDeploymentEnvironment represents pending deployment environment properties. +type PendingDeploymentEnvironment struct { + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` +} + +// ReviewCustomDeploymentProtectionRuleRequest specifies the parameters to ReviewCustomDeploymentProtectionRule. +type ReviewCustomDeploymentProtectionRuleRequest struct { + EnvironmentName string `json:"environment_name"` + State string `json:"state"` + Comment string `json:"comment"` +} + func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { u, err := addOptions(endpoint, opts) if err != nil { @@ -388,6 +413,28 @@ func (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, rep return workflowRunUsage, resp, nil } +// GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass. +// +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run +// +//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments +func (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/pending_deployments", owner, repo, runID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var deployments []*PendingDeployment + resp, err := s.client.Do(ctx, req, &deployments) + if err != nil { + return nil, resp, err + } + + return deployments, resp, nil +} + // PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer. // // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run @@ -409,3 +456,20 @@ func (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo str return deployments, resp, nil } + +// ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run. +// +// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run +// +//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule +func (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo string, runID int64, request *ReviewCustomDeploymentProtectionRuleRequest) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/deployment_protection_rule", owner, repo, runID) + + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + return resp, err +} diff --git a/vendor/github.com/google/go-github/v65/github/actions_workflows.go b/vendor/github.com/google/go-github/v66/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/actions_workflows.go rename to vendor/github.com/google/go-github/v66/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v65/github/activity.go b/vendor/github.com/google/go-github/v66/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/activity.go rename to vendor/github.com/google/go-github/v66/github/activity.go diff --git a/vendor/github.com/google/go-github/v65/github/activity_events.go b/vendor/github.com/google/go-github/v66/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/activity_events.go rename to vendor/github.com/google/go-github/v66/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v65/github/activity_notifications.go b/vendor/github.com/google/go-github/v66/github/activity_notifications.go similarity index 92% rename from vendor/github.com/google/go-github/v65/github/activity_notifications.go rename to vendor/github.com/google/go-github/v66/github/activity_notifications.go index 47f22261dd..e712323ed4 100644 --- a/vendor/github.com/google/go-github/v65/github/activity_notifications.go +++ b/vendor/github.com/google/go-github/v66/github/activity_notifications.go @@ -178,6 +178,23 @@ func (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Respo return s.client.Do(ctx, req, nil) } +// MarkThreadDone marks the specified thread as done. +// Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done. +// +// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done +// +//meta:operation DELETE /notifications/threads/{thread_id} +func (s *ActivityService) MarkThreadDone(ctx context.Context, id int64) (*Response, error) { + u := fmt.Sprintf("notifications/threads/%v", id) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + // GetThreadSubscription checks to see if the authenticated user is subscribed // to a thread. // diff --git a/vendor/github.com/google/go-github/v65/github/activity_star.go b/vendor/github.com/google/go-github/v66/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/activity_star.go rename to vendor/github.com/google/go-github/v66/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v65/github/activity_watching.go b/vendor/github.com/google/go-github/v66/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/activity_watching.go rename to vendor/github.com/google/go-github/v66/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v65/github/admin.go b/vendor/github.com/google/go-github/v66/github/admin.go similarity index 97% rename from vendor/github.com/google/go-github/v65/github/admin.go rename to vendor/github.com/google/go-github/v66/github/admin.go index e93c2266bd..c932cbe6ad 100644 --- a/vendor/github.com/google/go-github/v65/github/admin.go +++ b/vendor/github.com/google/go-github/v66/github/admin.go @@ -82,7 +82,7 @@ func (m Enterprise) String() string { // UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user // //meta:operation PATCH /admin/ldap/users/{username}/mapping func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) { @@ -103,7 +103,7 @@ func (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, m // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team // //meta:operation PATCH /admin/ldap/teams/{team_id}/mapping func (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/admin_orgs.go b/vendor/github.com/google/go-github/v66/github/admin_orgs.go similarity index 93% rename from vendor/github.com/google/go-github/v65/github/admin_orgs.go rename to vendor/github.com/google/go-github/v66/github/admin_orgs.go index cb11fe47f4..f1e728707d 100644 --- a/vendor/github.com/google/go-github/v65/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v66/github/admin_orgs.go @@ -22,7 +22,7 @@ type createOrgRequest struct { // Note that only a subset of the org fields are used and org must // not be nil. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization // //meta:operation POST /admin/organizations func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { @@ -61,7 +61,7 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) { @@ -70,7 +70,7 @@ func (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name // //meta:operation PATCH /admin/organizations/{org} func (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/admin_stats.go b/vendor/github.com/google/go-github/v66/github/admin_stats.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/admin_stats.go rename to vendor/github.com/google/go-github/v66/github/admin_stats.go index 7041262514..51b7d86fc3 100644 --- a/vendor/github.com/google/go-github/v65/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v66/github/admin_stats.go @@ -152,7 +152,7 @@ func (s RepoStats) String() string { // Please note that this is only available to site administrators, // otherwise it will error with a 404 not found (instead of 401 or 403). // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics // //meta:operation GET /enterprise/stats/all func (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/admin_users.go b/vendor/github.com/google/go-github/v66/github/admin_users.go similarity index 94% rename from vendor/github.com/google/go-github/v65/github/admin_users.go rename to vendor/github.com/google/go-github/v66/github/admin_users.go index 82e568a0ac..e447f002ac 100644 --- a/vendor/github.com/google/go-github/v65/github/admin_users.go +++ b/vendor/github.com/google/go-github/v66/github/admin_users.go @@ -20,7 +20,7 @@ type CreateUserRequest struct { // CreateUser creates a new user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user // //meta:operation POST /admin/users func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) { @@ -42,7 +42,7 @@ func (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest // DeleteUser deletes a user in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user // //meta:operation DELETE /admin/users/{username} func (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) { @@ -95,7 +95,7 @@ type UserAuthorization struct { // CreateUserImpersonation creates an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) { @@ -117,7 +117,7 @@ func (s *AdminService) CreateUserImpersonation(ctx context.Context, username str // DeleteUserImpersonation deletes an impersonation OAuth token. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/apps.go b/vendor/github.com/google/go-github/v66/github/apps.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/apps.go rename to vendor/github.com/google/go-github/v66/github/apps.go diff --git a/vendor/github.com/google/go-github/v65/github/apps_hooks.go b/vendor/github.com/google/go-github/v66/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/apps_hooks.go rename to vendor/github.com/google/go-github/v66/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v65/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v66/github/apps_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v66/github/apps_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v65/github/apps_installation.go b/vendor/github.com/google/go-github/v66/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/apps_installation.go rename to vendor/github.com/google/go-github/v66/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v65/github/apps_manifest.go b/vendor/github.com/google/go-github/v66/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/apps_manifest.go rename to vendor/github.com/google/go-github/v66/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v65/github/apps_marketplace.go b/vendor/github.com/google/go-github/v66/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v66/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v66/github/attestations.go b/vendor/github.com/google/go-github/v66/github/attestations.go new file mode 100644 index 0000000000..618d5d73f6 --- /dev/null +++ b/vendor/github.com/google/go-github/v66/github/attestations.go @@ -0,0 +1,27 @@ +// Copyright 2024 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 ( + "encoding/json" +) + +// Attestation represents an artifact attestation associated with a repository. +// The provided bundle can be used to verify the provenance of artifacts. +// +// https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds +type Attestation struct { + // The attestation's Sigstore Bundle. + // Refer to the sigstore bundle specification for more info: + // https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto + Bundle json.RawMessage `json:"bundle"` + RepositoryID int64 `json:"repository_id"` +} + +// AttestationsResponse represents a collection of artifact attestations. +type AttestationsResponse struct { + Attestations []*Attestation `json:"attestations"` +} diff --git a/vendor/github.com/google/go-github/v65/github/authorizations.go b/vendor/github.com/google/go-github/v66/github/authorizations.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/authorizations.go rename to vendor/github.com/google/go-github/v66/github/authorizations.go index 9bfff7330a..5e63a3efb9 100644 --- a/vendor/github.com/google/go-github/v65/github/authorizations.go +++ b/vendor/github.com/google/go-github/v66/github/authorizations.go @@ -15,7 +15,7 @@ import ( // GitHub API docs: https://docs.github.com/rest/oauth/#scopes type Scope string -// This is the set of scopes for GitHub API V3 +// This is the set of scopes for GitHub API V3. const ( ScopeNone Scope = "(no scope)" // REVISIT: is this actually returned, or just a documentation artifact? ScopeUser Scope = "user" @@ -257,7 +257,7 @@ func (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, acces // you can e.g. create or delete a user's public SSH key. NOTE: creating a // new token automatically revokes an existing one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token // //meta:operation POST /admin/users/{username}/authorizations func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) { @@ -279,7 +279,7 @@ func (s *AuthorizationsService) CreateImpersonation(ctx context.Context, usernam // // NOTE: there can be only one at a time. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token // //meta:operation DELETE /admin/users/{username}/authorizations func (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/billing.go b/vendor/github.com/google/go-github/v66/github/billing.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/billing.go rename to vendor/github.com/google/go-github/v66/github/billing.go diff --git a/vendor/github.com/google/go-github/v65/github/checks.go b/vendor/github.com/google/go-github/v66/github/checks.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/checks.go rename to vendor/github.com/google/go-github/v66/github/checks.go index a861894453..711be207c2 100644 --- a/vendor/github.com/google/go-github/v65/github/checks.go +++ b/vendor/github.com/google/go-github/v66/github/checks.go @@ -85,7 +85,10 @@ type CheckSuite struct { PullRequests []*PullRequest `json:"pull_requests,omitempty"` // The following fields are only populated by Webhook events. - HeadCommit *Commit `json:"head_commit,omitempty"` + HeadCommit *Commit `json:"head_commit,omitempty"` + LatestCheckRunsCount *int64 `json:"latest_check_runs_count,omitempty"` + Rerequstable *bool `json:"rerequestable,omitempty"` + RunsRerequstable *bool `json:"runs_rerequestable,omitempty"` } func (c CheckRun) String() string { @@ -398,7 +401,7 @@ type CheckSuitePreferenceResults struct { Repository *Repository `json:"repository,omitempty"` } -// PreferenceList represents a list of auto trigger checks for repository +// PreferenceList represents a list of auto trigger checks for repository. type PreferenceList struct { AutoTriggerChecks []*AutoTriggerCheck `json:"auto_trigger_checks,omitempty"` // A slice of auto trigger checks that can be set for a check suite in a repository. } @@ -426,7 +429,7 @@ func (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, rep return checkSuitePrefResults, resp, nil } -// CreateCheckSuiteOptions sets up parameters to manually create a check suites +// CreateCheckSuiteOptions sets up parameters to manually create a check suites. type CreateCheckSuiteOptions struct { HeadSHA string `json:"head_sha"` // The sha of the head commit. (Required.) HeadBranch *string `json:"head_branch,omitempty"` // The name of the head branch where the code changes are implemented. diff --git a/vendor/github.com/google/go-github/v65/github/code-scanning.go b/vendor/github.com/google/go-github/v66/github/code-scanning.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/code-scanning.go rename to vendor/github.com/google/go-github/v66/github/code-scanning.go diff --git a/vendor/github.com/google/go-github/v65/github/codesofconduct.go b/vendor/github.com/google/go-github/v66/github/codesofconduct.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/codesofconduct.go rename to vendor/github.com/google/go-github/v66/github/codesofconduct.go index 7d7f9ef818..aba0574171 100644 --- a/vendor/github.com/google/go-github/v65/github/codesofconduct.go +++ b/vendor/github.com/google/go-github/v66/github/codesofconduct.go @@ -50,7 +50,7 @@ func (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Re // ListCodesOfConduct returns all codes of conduct. // -// Deprecated: Use CodesOfConductService.List instead +// Deprecated: Use CodesOfConductService.List instead. func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) { return c.CodesOfConduct.List(ctx) } @@ -81,7 +81,7 @@ func (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfCon // GetCodeOfConduct returns an individual code of conduct. // -// Deprecated: Use CodesOfConductService.Get instead +// Deprecated: Use CodesOfConductService.Get instead. func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) { return c.CodesOfConduct.Get(ctx, key) } diff --git a/vendor/github.com/google/go-github/v65/github/codespaces.go b/vendor/github.com/google/go-github/v66/github/codespaces.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/codespaces.go rename to vendor/github.com/google/go-github/v66/github/codespaces.go diff --git a/vendor/github.com/google/go-github/v65/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v66/github/codespaces_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v66/github/codespaces_secrets.go diff --git a/vendor/github.com/google/go-github/v65/github/copilot.go b/vendor/github.com/google/go-github/v66/github/copilot.go similarity index 62% rename from vendor/github.com/google/go-github/v65/github/copilot.go rename to vendor/github.com/google/go-github/v66/github/copilot.go index 2697b71850..7ea13bd7c8 100644 --- a/vendor/github.com/google/go-github/v65/github/copilot.go +++ b/vendor/github.com/google/go-github/v66/github/copilot.go @@ -8,7 +8,9 @@ package github import ( "context" "encoding/json" + "errors" "fmt" + "time" ) // CopilotService provides access to the Copilot-related functions @@ -51,6 +53,7 @@ type CopilotSeatDetails struct { LastActivityEditor *string `json:"last_activity_editor,omitempty"` CreatedAt *Timestamp `json:"created_at"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` + PlanType *string `json:"plan_type,omitempty"` } // SeatAssignments represents the number of seats assigned. @@ -63,6 +66,39 @@ type SeatCancellations struct { SeatsCancelled int `json:"seats_cancelled"` } +// CopilotUsageSummaryListOptions represents the optional parameters to the CopilotService.GetOrganizationUsage method. +type CopilotUsageSummaryListOptions struct { + Since *time.Time `url:"since,omitempty"` + Until *time.Time `url:"until,omitempty"` + + ListOptions +} + +// CopilotUsageBreakdown represents the breakdown of Copilot usage for a specific language and editor. +type CopilotUsageBreakdown struct { + Language string `json:"language"` + Editor string `json:"editor"` + SuggestionsCount int64 `json:"suggestions_count"` + AcceptancesCount int64 `json:"acceptances_count"` + LinesSuggested int64 `json:"lines_suggested"` + LinesAccepted int64 `json:"lines_accepted"` + ActiveUsers int `json:"active_users"` +} + +// CopilotUsageSummary represents the daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. +type CopilotUsageSummary struct { + Day string `json:"day"` + TotalSuggestionsCount int64 `json:"total_suggestions_count"` + TotalAcceptancesCount int64 `json:"total_acceptances_count"` + TotalLinesSuggested int64 `json:"total_lines_suggested"` + TotalLinesAccepted int64 `json:"total_lines_accepted"` + TotalActiveUsers int64 `json:"total_active_users"` + TotalChatAcceptances int64 `json:"total_chat_acceptances"` + TotalChatTurns int64 `json:"total_chat_turns"` + TotalActiveChatUsers int `json:"total_active_chat_users"` + Breakdown []*CopilotUsageBreakdown `json:"breakdown"` +} + func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { // Using an alias to avoid infinite recursion when calling json.Unmarshal type alias CopilotSeatDetails @@ -78,6 +114,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { cp.LastActivityEditor = seatDetail.LastActivityEditor cp.CreatedAt = seatDetail.CreatedAt cp.UpdatedAt = seatDetail.UpdatedAt + cp.PlanType = seatDetail.PlanType switch v := seatDetail.Assignee.(type) { case map[string]interface{}: @@ -87,7 +124,7 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { } if v["type"] == nil { - return fmt.Errorf("assignee type field is not set") + return errors.New("assignee type field is not set") } if t, ok := v["type"].(string); ok && t == "User" { @@ -180,6 +217,34 @@ func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts return copilotSeats, resp, nil } +// ListCopilotEnterpriseSeats lists Copilot for Business seat assignments for an enterprise. +// +// To paginate through all seats, populate 'Page' with the number of the last page. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/copilot/billing/seats +func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/billing/seats", enterprise) + 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 copilotSeats *ListCopilotSeatsResponse + resp, err := s.client.Do(ctx, req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + return copilotSeats, resp, nil +} + // AddCopilotTeams adds teams to the Copilot for Business subscription for an organization. // // GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization @@ -313,3 +378,107 @@ func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) ( return seatDetails, resp, nil } + +// GetOrganizationUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members +// +//meta:operation GET /orgs/{org}/copilot/usage +func (s *CopilotService) GetOrganizationUsage(ctx context.Context, org string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/usage", 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 + } + + var usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} + +// GetEnterpriseUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an enterprise. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-enterprise-members +// +//meta:operation GET /enterprises/{enterprise}/copilot/usage +func (s *CopilotService) GetEnterpriseUsage(ctx context.Context, enterprise string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/usage", enterprise) + 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 usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} + +// GetEnterpriseTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the enterprise. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-an-enterprise-team +// +//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/usage +func (s *CopilotService) GetEnterpriseTeamUsage(ctx context.Context, enterprise, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("enterprises/%v/team/%v/copilot/usage", enterprise, team) + 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 usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} + +// GetOrganizationTeamUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE for a team in the organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-a-team +// +//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/usage +func (s *CopilotService) GetOrganizationTeamUsage(ctx context.Context, org, team string, opts *CopilotUsageSummaryListOptions) ([]*CopilotUsageSummary, *Response, error) { + u := fmt.Sprintf("orgs/%v/team/%v/copilot/usage", org, team) + 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 usage []*CopilotUsageSummary + resp, err := s.client.Do(ctx, req, &usage) + if err != nil { + return nil, resp, err + } + + return usage, resp, nil +} diff --git a/vendor/github.com/google/go-github/v65/github/dependabot.go b/vendor/github.com/google/go-github/v66/github/dependabot.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/dependabot.go rename to vendor/github.com/google/go-github/v66/github/dependabot.go diff --git a/vendor/github.com/google/go-github/v65/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v66/github/dependabot_alerts.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v66/github/dependabot_alerts.go diff --git a/vendor/github.com/google/go-github/v65/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v66/github/dependabot_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v66/github/dependabot_secrets.go diff --git a/vendor/github.com/google/go-github/v65/github/dependency_graph.go b/vendor/github.com/google/go-github/v66/github/dependency_graph.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/dependency_graph.go rename to vendor/github.com/google/go-github/v66/github/dependency_graph.go diff --git a/vendor/github.com/google/go-github/v65/github/dependency_graph_snapshots.go b/vendor/github.com/google/go-github/v66/github/dependency_graph_snapshots.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/dependency_graph_snapshots.go rename to vendor/github.com/google/go-github/v66/github/dependency_graph_snapshots.go diff --git a/vendor/github.com/google/go-github/v65/github/doc.go b/vendor/github.com/google/go-github/v66/github/doc.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/doc.go rename to vendor/github.com/google/go-github/v66/github/doc.go index f98f84ef20..7196394fb9 100644 --- a/vendor/github.com/google/go-github/v65/github/doc.go +++ b/vendor/github.com/google/go-github/v66/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v65/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v66/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 @@ -31,7 +31,7 @@ The services of a client divide the API into logical chunks and correspond to the structure of the GitHub API documentation at https://docs.github.com/rest . -NOTE: Using the https://godoc.org/context package, one can easily +NOTE: Using the https://pkg.go.dev/context package, one can easily pass cancelation signals and deadlines to various services of the client for handling a request. In case there is no context available, then context.Background() can be used as a starting point. diff --git a/vendor/github.com/google/go-github/v65/github/emojis.go b/vendor/github.com/google/go-github/v66/github/emojis.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/emojis.go rename to vendor/github.com/google/go-github/v66/github/emojis.go index 93ef232f6c..b7a03dd98c 100644 --- a/vendor/github.com/google/go-github/v65/github/emojis.go +++ b/vendor/github.com/google/go-github/v66/github/emojis.go @@ -34,7 +34,7 @@ func (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, // ListEmojis returns the emojis available to use on GitHub. // -// Deprecated: Use EmojisService.List instead +// Deprecated: Use EmojisService.List instead. func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) { return c.Emojis.List(ctx) } diff --git a/vendor/github.com/google/go-github/v65/github/enterprise.go b/vendor/github.com/google/go-github/v66/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/enterprise.go rename to vendor/github.com/google/go-github/v66/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v65/github/enterprise_actions_runner_groups.go b/vendor/github.com/google/go-github/v66/github/enterprise_actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/enterprise_actions_runner_groups.go rename to vendor/github.com/google/go-github/v66/github/enterprise_actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v65/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v66/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v66/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v65/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v66/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v66/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v65/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v66/github/enterprise_code_security_and_analysis.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v66/github/enterprise_code_security_and_analysis.go diff --git a/vendor/github.com/google/go-github/v65/github/event.go b/vendor/github.com/google/go-github/v66/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/event.go rename to vendor/github.com/google/go-github/v66/github/event.go diff --git a/vendor/github.com/google/go-github/v65/github/event_types.go b/vendor/github.com/google/go-github/v66/github/event_types.go similarity index 94% rename from vendor/github.com/google/go-github/v65/github/event_types.go rename to vendor/github.com/google/go-github/v66/github/event_types.go index 41d71f8ddf..40ad919be5 100644 --- a/vendor/github.com/google/go-github/v65/github/event_types.go +++ b/vendor/github.com/google/go-github/v66/github/event_types.go @@ -29,6 +29,19 @@ type BranchProtectionRuleEvent struct { Installation *Installation `json:"installation,omitempty"` } +// BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository. +// The Webhook event name is "branch_protection_configuration". +// +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration +type BranchProtectionConfigurationEvent struct { + Action *string `json:"action,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Org *Organization `json:"organization,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + // CheckRunEvent is triggered when a check run is "created", "completed", or "rerequested". // The Webhook event name is "check_run". // @@ -225,6 +238,46 @@ type DeploymentProtectionRuleEvent struct { Installation *Installation `json:"installation,omitempty"` } +// DeploymentReviewEvent represents a deployment review event. +// The Webhook event name is "deployment_review". +// +// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads?#deployment_review +type DeploymentReviewEvent struct { + // The action performed. Possible values are: "requested", "approved", or "rejected". + Action *string `json:"action,omitempty"` + + // The following will be populated only if requested. + Requester *User `json:"requester,omitempty"` + Environment *string `json:"environment,omitempty"` + + // The following will be populated only if approved or rejected. + Approver *User `json:"approver,omitempty"` + Comment *string `json:"comment,omitempty"` + WorkflowJobRuns []*WorkflowJobRun `json:"workflow_job_runs,omitempty"` + + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Reviewers []*RequiredReviewer `json:"reviewers,omitempty"` + Sender *User `json:"sender,omitempty"` + Since *string `json:"since,omitempty"` + WorkflowJobRun *WorkflowJobRun `json:"workflow_job_run,omitempty"` + WorkflowRun *WorkflowRun `json:"workflow_run,omitempty"` +} + +// WorkflowJobRun represents a workflow_job_run in a GitHub DeploymentReviewEvent. +type WorkflowJobRun struct { + Conclusion *string `json:"conclusion,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Environment *string `json:"environment,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + // DeploymentStatusEvent represents a deployment status. // The Webhook event name is "deployment_status". // @@ -713,8 +766,7 @@ type MemberChanges struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member type MemberEvent struct { - // Action is the action that was performed. Possible values are: - //"added", "edited", "removed". + // Action is the action that was performed. Possible values are: "added", "edited", "removed". Action *string `json:"action,omitempty"` Member *User `json:"member,omitempty"` Changes *MemberChanges `json:"changes,omitempty"` @@ -1465,6 +1517,22 @@ type RepositoryImportEvent struct { Sender *User `json:"sender,omitempty"` } +// RepositoryRulesetEvent triggers whenever there is a change to the repository's ruleset configuration. +// +// This can include updates to protection rules, required status checks, code owners, or other related configurations. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset +type RepositoryRulesetEvent struct { + Action *string `json:"action,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repository *Repository `json:"repository,omitempty"` + RepositoryRuleset *RepositoryRuleset `json:"repository_ruleset"` + Changes *RepositoryRulesetEditedChanges `json:"changes,omitempty"` + Sender *User `json:"sender"` +} + // RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved. // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert @@ -1525,6 +1593,20 @@ type SecretScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } +// SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert. +// The Webhook event name is "secret_scanning_alert_location". +// +// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location +type SecretScanningAlertLocationEvent struct { + Action *string `json:"action,omitempty"` + Alert *SecretScanningAlert `json:"alert,omitempty"` + Installation *Installation `json:"installation,omitempty"` + Location *SecretScanningAlertLocation `json:"location,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Repo *Repository `json:"repository,omitempty"` + Sender *User `json:"sender,omitempty"` +} + // SecurityAndAnalysisEvent is triggered when code security and analysis features // are enabled or disabled for a repository. // diff --git a/vendor/github.com/google/go-github/v65/github/gists.go b/vendor/github.com/google/go-github/v66/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/gists.go rename to vendor/github.com/google/go-github/v66/github/gists.go diff --git a/vendor/github.com/google/go-github/v65/github/gists_comments.go b/vendor/github.com/google/go-github/v66/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/gists_comments.go rename to vendor/github.com/google/go-github/v66/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v65/github/git.go b/vendor/github.com/google/go-github/v66/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/git.go rename to vendor/github.com/google/go-github/v66/github/git.go diff --git a/vendor/github.com/google/go-github/v65/github/git_blobs.go b/vendor/github.com/google/go-github/v66/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/git_blobs.go rename to vendor/github.com/google/go-github/v66/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v65/github/git_commits.go b/vendor/github.com/google/go-github/v66/github/git_commits.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/git_commits.go rename to vendor/github.com/google/go-github/v66/github/git_commits.go index 573d38be52..fdb3d26cea 100644 --- a/vendor/github.com/google/go-github/v65/github/git_commits.go +++ b/vendor/github.com/google/go-github/v66/github/git_commits.go @@ -129,7 +129,7 @@ type CreateCommitOptions struct { //meta:operation POST /repos/{owner}/{repo}/git/commits func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string, commit *Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { if commit == nil { - return nil, nil, fmt.Errorf("commit must be provided") + return nil, nil, errors.New("commit must be provided") } if opts == nil { opts = &CreateCommitOptions{} diff --git a/vendor/github.com/google/go-github/v65/github/git_refs.go b/vendor/github.com/google/go-github/v66/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/git_refs.go rename to vendor/github.com/google/go-github/v66/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v65/github/git_tags.go b/vendor/github.com/google/go-github/v66/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/git_tags.go rename to vendor/github.com/google/go-github/v66/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v65/github/git_trees.go b/vendor/github.com/google/go-github/v66/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/git_trees.go rename to vendor/github.com/google/go-github/v66/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v65/github/github-accessors.go b/vendor/github.com/google/go-github/v66/github/github-accessors.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/github-accessors.go rename to vendor/github.com/google/go-github/v66/github/github-accessors.go index 1abbabd0b6..acc54e7d96 100644 --- a/vendor/github.com/google/go-github/v65/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v66/github/github-accessors.go @@ -1646,6 +1646,54 @@ func (b *BranchPolicy) GetProtectedBranches() bool { return *b.ProtectedBranches } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (b *BranchProtectionConfigurationEvent) GetAction() string { + if b == nil || b.Action == nil { + return "" + } + return *b.Action +} + +// GetEnterprise returns the Enterprise field. +func (b *BranchProtectionConfigurationEvent) GetEnterprise() *Enterprise { + if b == nil { + return nil + } + return b.Enterprise +} + +// GetInstallation returns the Installation field. +func (b *BranchProtectionConfigurationEvent) GetInstallation() *Installation { + if b == nil { + return nil + } + return b.Installation +} + +// GetOrg returns the Org field. +func (b *BranchProtectionConfigurationEvent) GetOrg() *Organization { + if b == nil { + return nil + } + return b.Org +} + +// GetRepo returns the Repo field. +func (b *BranchProtectionConfigurationEvent) GetRepo() *Repository { + if b == nil { + return nil + } + return b.Repo +} + +// GetSender returns the Sender field. +func (b *BranchProtectionConfigurationEvent) GetSender() *User { + if b == nil { + return nil + } + return b.Sender +} + // GetAdminEnforced returns the AdminEnforced field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetAdminEnforced() bool { if b == nil || b.AdminEnforced == nil { @@ -2286,6 +2334,14 @@ func (c *CheckSuite) GetID() int64 { return *c.ID } +// GetLatestCheckRunsCount returns the LatestCheckRunsCount field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetLatestCheckRunsCount() int64 { + if c == nil || c.LatestCheckRunsCount == nil { + return 0 + } + return *c.LatestCheckRunsCount +} + // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. func (c *CheckSuite) GetNodeID() string { if c == nil || c.NodeID == nil { @@ -2302,6 +2358,22 @@ func (c *CheckSuite) GetRepository() *Repository { return c.Repository } +// GetRerequstable returns the Rerequstable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRerequstable() bool { + if c == nil || c.Rerequstable == nil { + return false + } + return *c.Rerequstable +} + +// GetRunsRerequstable returns the RunsRerequstable field if it's non-nil, zero value otherwise. +func (c *CheckSuite) GetRunsRerequstable() bool { + if c == nil || c.RunsRerequstable == nil { + return false + } + return *c.RunsRerequstable +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (c *CheckSuite) GetStatus() string { if c == nil || c.Status == nil { @@ -2638,6 +2710,190 @@ func (c *CodeSearchResult) GetTotal() int { return *c.Total } +// GetAdvancedSecurity returns the AdvancedSecurity field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetAdvancedSecurity() string { + if c == nil || c.AdvancedSecurity == nil { + return "" + } + return *c.AdvancedSecurity +} + +// GetCodeScanningDefaultSetup returns the CodeScanningDefaultSetup field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetCodeScanningDefaultSetup() string { + if c == nil || c.CodeScanningDefaultSetup == nil { + return "" + } + return *c.CodeScanningDefaultSetup +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDependabotAlerts returns the DependabotAlerts field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependabotAlerts() string { + if c == nil || c.DependabotAlerts == nil { + return "" + } + return *c.DependabotAlerts +} + +// GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependabotSecurityUpdates() string { + if c == nil || c.DependabotSecurityUpdates == nil { + return "" + } + return *c.DependabotSecurityUpdates +} + +// GetDependencyGraph returns the DependencyGraph field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependencyGraph() string { + if c == nil || c.DependencyGraph == nil { + return "" + } + return *c.DependencyGraph +} + +// GetDependencyGraphAutosubmitAction returns the DependencyGraphAutosubmitAction field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitAction() string { + if c == nil || c.DependencyGraphAutosubmitAction == nil { + return "" + } + return *c.DependencyGraphAutosubmitAction +} + +// GetDependencyGraphAutosubmitActionOptions returns the DependencyGraphAutosubmitActionOptions field. +func (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions() *DependencyGraphAutosubmitActionOptions { + if c == nil { + return nil + } + return c.DependencyGraphAutosubmitActionOptions +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetEnforcement() string { + if c == nil || c.Enforcement == nil { + return "" + } + return *c.Enforcement +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetHTMLURL() string { + if c == nil || c.HTMLURL == nil { + return "" + } + return *c.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetPrivateVulnerabilityReporting returns the PrivateVulnerabilityReporting field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting() string { + if c == nil || c.PrivateVulnerabilityReporting == nil { + return "" + } + return *c.PrivateVulnerabilityReporting +} + +// GetSecretScanning returns the SecretScanning field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanning() string { + if c == nil || c.SecretScanning == nil { + return "" + } + return *c.SecretScanning +} + +// GetSecretScanningNonProviderPatterns returns the SecretScanningNonProviderPatterns field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningNonProviderPatterns() string { + if c == nil || c.SecretScanningNonProviderPatterns == nil { + return "" + } + return *c.SecretScanningNonProviderPatterns +} + +// GetSecretScanningPushProtection returns the SecretScanningPushProtection field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningPushProtection() string { + if c == nil || c.SecretScanningPushProtection == nil { + return "" + } + return *c.SecretScanningPushProtection +} + +// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetSecretScanningValidityChecks() string { + if c == nil || c.SecretScanningValidityChecks == nil { + return "" + } + return *c.SecretScanningValidityChecks +} + +// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetTargetType() string { + if c == nil || c.TargetType == nil { + return "" + } + return *c.TargetType +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfiguration) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + +// GetConfiguration returns the Configuration field. +func (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetConfiguration() *CodeSecurityConfiguration { + if c == nil { + return nil + } + return c.Configuration +} + +// GetDefaultForNewRepos returns the DefaultForNewRepos field if it's non-nil, zero value otherwise. +func (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetDefaultForNewRepos() string { + if c == nil || c.DefaultForNewRepos == nil { + return "" + } + return *c.DefaultForNewRepos +} + // GetBillableOwner returns the BillableOwner field. func (c *Codespace) GetBillableOwner() *User { if c == nil { @@ -4086,6 +4342,14 @@ func (c *CopilotSeatDetails) GetPendingCancellationDate() string { return *c.PendingCancellationDate } +// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise. +func (c *CopilotSeatDetails) GetPlanType() string { + if c == nil || c.PlanType == nil { + return "" + } + return *c.PlanType +} + // GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { if c == nil || c.UpdatedAt == nil { @@ -4094,6 +4358,22 @@ func (c *CopilotSeatDetails) GetUpdatedAt() Timestamp { return *c.UpdatedAt } +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (c *CopilotUsageSummaryListOptions) GetSince() time.Time { + if c == nil || c.Since == nil { + return time.Time{} + } + return *c.Since +} + +// GetUntil returns the Until field if it's non-nil, zero value otherwise. +func (c *CopilotUsageSummaryListOptions) GetUntil() time.Time { + if c == nil || c.Until == nil { + return time.Time{} + } + return *c.Until +} + // GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise. func (c *CreateCheckRunOptions) GetCompletedAt() Timestamp { if c == nil || c.CompletedAt == nil { @@ -4390,6 +4670,14 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { if c == nil || c.Description == nil { @@ -5326,6 +5614,14 @@ func (d *Dependency) GetScope() string { return *d.Scope } +// GetLabeledRunners returns the LabeledRunners field if it's non-nil, zero value otherwise. +func (d *DependencyGraphAutosubmitActionOptions) GetLabeledRunners() bool { + if d == nil || d.LabeledRunners == nil { + return false + } + return *d.LabeledRunners +} + // GetDetector returns the Detector field. func (d *DependencyGraphSnapshot) GetDetector() *DependencyGraphSnapshotDetector { if d == nil { @@ -5886,79 +6182,183 @@ func (d *DeploymentRequest) GetTransientEnvironment() bool { return *d.TransientEnvironment } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetCreatedAt() Timestamp { - if d == nil || d.CreatedAt == nil { - return Timestamp{} +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" } - return *d.CreatedAt + return *d.Action } -// GetCreator returns the Creator field. -func (d *DeploymentStatus) GetCreator() *User { +// GetApprover returns the Approver field. +func (d *DeploymentReviewEvent) GetApprover() *User { if d == nil { return nil } - return d.Creator + return d.Approver } -// GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetDeploymentURL() string { - if d == nil || d.DeploymentURL == nil { +// GetComment returns the Comment field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetComment() string { + if d == nil || d.Comment == nil { return "" } - return *d.DeploymentURL + return *d.Comment } -// GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetDescription() string { - if d == nil || d.Description == nil { - return "" +// GetEnterprise returns the Enterprise field. +func (d *DeploymentReviewEvent) GetEnterprise() *Enterprise { + if d == nil { + return nil } - return *d.Description + return d.Enterprise } // GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetEnvironment() string { +func (d *DeploymentReviewEvent) GetEnvironment() string { if d == nil || d.Environment == nil { return "" } return *d.Environment } -// GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetEnvironmentURL() string { - if d == nil || d.EnvironmentURL == nil { - return "" +// GetInstallation returns the Installation field. +func (d *DeploymentReviewEvent) GetInstallation() *Installation { + if d == nil { + return nil } - return *d.EnvironmentURL + return d.Installation } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetID() int64 { - if d == nil || d.ID == nil { - return 0 +// GetOrganization returns the Organization field. +func (d *DeploymentReviewEvent) GetOrganization() *Organization { + if d == nil { + return nil } - return *d.ID + return d.Organization } -// GetLogURL returns the LogURL field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetLogURL() string { - if d == nil || d.LogURL == nil { - return "" +// GetRepo returns the Repo field. +func (d *DeploymentReviewEvent) GetRepo() *Repository { + if d == nil { + return nil } - return *d.LogURL + return d.Repo } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (d *DeploymentStatus) GetNodeID() string { - if d == nil || d.NodeID == nil { - return "" +// GetRequester returns the Requester field. +func (d *DeploymentReviewEvent) GetRequester() *User { + if d == nil { + return nil } - return *d.NodeID + return d.Requester } -// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. +// GetSender returns the Sender field. +func (d *DeploymentReviewEvent) GetSender() *User { + if d == nil { + return nil + } + return d.Sender +} + +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (d *DeploymentReviewEvent) GetSince() string { + if d == nil || d.Since == nil { + return "" + } + return *d.Since +} + +// GetWorkflowJobRun returns the WorkflowJobRun field. +func (d *DeploymentReviewEvent) GetWorkflowJobRun() *WorkflowJobRun { + if d == nil { + return nil + } + return d.WorkflowJobRun +} + +// GetWorkflowRun returns the WorkflowRun field. +func (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun { + if d == nil { + return nil + } + return d.WorkflowRun +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetCreator returns the Creator field. +func (d *DeploymentStatus) GetCreator() *User { + if d == nil { + return nil + } + return d.Creator +} + +// GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetDeploymentURL() string { + if d == nil || d.DeploymentURL == nil { + return "" + } + return *d.DeploymentURL +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetDescription() string { + if d == nil || d.Description == nil { + return "" + } + return *d.Description +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetEnvironment() string { + if d == nil || d.Environment == nil { + return "" + } + return *d.Environment +} + +// GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetEnvironmentURL() string { + if d == nil || d.EnvironmentURL == nil { + return "" + } + return *d.EnvironmentURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetID() int64 { + if d == nil || d.ID == nil { + return 0 + } + return *d.ID +} + +// GetLogURL returns the LogURL field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetLogURL() string { + if d == nil || d.LogURL == nil { + return "" + } + return *d.LogURL +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (d *DeploymentStatus) GetNodeID() string { + if d == nil || d.NodeID == nil { + return "" + } + return *d.NodeID +} + +// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise. func (d *DeploymentStatus) GetRepositoryURL() string { if d == nil || d.RepositoryURL == nil { return "" @@ -10886,6 +11286,14 @@ func (l *ListAlertsOptions) GetState() string { return *l.State } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (l *ListArtifactsOptions) GetName() string { + if l == nil || l.Name == nil { + return "" + } + return *l.Name +} + // GetAppID returns the AppID field if it's non-nil, zero value otherwise. func (l *ListCheckRunsOptions) GetAppID() int64 { if l == nil || l.AppID == nil { @@ -14390,6 +14798,78 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetCurrentUserCanApprove() bool { + if p == nil || p.CurrentUserCanApprove == nil { + return false + } + return *p.CurrentUserCanApprove +} + +// GetEnvironment returns the Environment field. +func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { + if p == nil { + return nil + } + return p.Environment +} + +// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetWaitTimer() int64 { + if p == nil || p.WaitTimer == nil { + return 0 + } + return *p.WaitTimer +} + +// GetWaitTimerStartedAt returns the WaitTimerStartedAt field if it's non-nil, zero value otherwise. +func (p *PendingDeployment) GetWaitTimerStartedAt() Timestamp { + if p == nil || p.WaitTimerStartedAt == nil { + return Timestamp{} + } + return *p.WaitTimerStartedAt +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetHTMLURL() string { + if p == nil || p.HTMLURL == nil { + return "" + } + return *p.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetNodeID() string { + if p == nil || p.NodeID == nil { + return "" + } + return *p.NodeID +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (p *PendingDeploymentEnvironment) GetURL() string { + if p == nil || p.URL == nil { + return "" + } + return *p.URL +} + // GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise. func (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp { if p == nil || p.AccessGrantedAt == nil { @@ -19582,6 +20062,22 @@ func (r *RepositoryActiveCommitters) GetName() string { return *r.Name } +// GetConfiguration returns the Configuration field. +func (r *RepositoryCodeSecurityConfiguration) GetConfiguration() *CodeSecurityConfiguration { + if r == nil { + return nil + } + return r.Configuration +} + +// GetState returns the State field if it's non-nil, zero value otherwise. +func (r *RepositoryCodeSecurityConfiguration) GetState() string { + if r == nil || r.State == nil { + return "" + } + return *r.State +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (r *RepositoryComment) GetBody() string { if r == nil || r.Body == nil { @@ -20030,6 +20526,14 @@ func (r *RepositoryInvitation) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetExpired returns the Expired field if it's non-nil, zero value otherwise. +func (r *RepositoryInvitation) GetExpired() bool { + if r == nil || r.Expired == nil { + return false + } + return *r.Expired +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (r *RepositoryInvitation) GetHTMLURL() string { if r == nil || r.HTMLURL == nil { @@ -20259,143 +20763,679 @@ func (r *RepositoryRelease) GetCreatedAt() Timestamp { if r == nil || r.CreatedAt == nil { return Timestamp{} } - return *r.CreatedAt + return *r.CreatedAt +} + +// GetDiscussionCategoryName returns the DiscussionCategoryName field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetDiscussionCategoryName() string { + if r == nil || r.DiscussionCategoryName == nil { + return "" + } + return *r.DiscussionCategoryName +} + +// GetDraft returns the Draft field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetDraft() bool { + if r == nil || r.Draft == nil { + return false + } + return *r.Draft +} + +// GetGenerateReleaseNotes returns the GenerateReleaseNotes field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetGenerateReleaseNotes() bool { + if r == nil || r.GenerateReleaseNotes == nil { + return false + } + return *r.GenerateReleaseNotes +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetHTMLURL() string { + if r == nil || r.HTMLURL == nil { + return "" + } + return *r.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + +// GetMakeLatest returns the MakeLatest field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetMakeLatest() string { + if r == nil || r.MakeLatest == nil { + return "" + } + return *r.MakeLatest +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + +// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetPrerelease() bool { + if r == nil || r.Prerelease == nil { + return false + } + return *r.Prerelease +} + +// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetPublishedAt() Timestamp { + if r == nil || r.PublishedAt == nil { + return Timestamp{} + } + return *r.PublishedAt +} + +// GetTagName returns the TagName field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetTagName() string { + if r == nil || r.TagName == nil { + return "" + } + return *r.TagName +} + +// GetTarballURL returns the TarballURL field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetTarballURL() string { + if r == nil || r.TarballURL == nil { + return "" + } + return *r.TarballURL +} + +// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetTargetCommitish() string { + if r == nil || r.TargetCommitish == nil { + return "" + } + return *r.TargetCommitish +} + +// GetUploadURL returns the UploadURL field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetUploadURL() string { + if r == nil || r.UploadURL == nil { + return "" + } + return *r.UploadURL +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetURL() string { + if r == nil || r.URL == nil { + return "" + } + return *r.URL +} + +// GetZipballURL returns the ZipballURL field if it's non-nil, zero value otherwise. +func (r *RepositoryRelease) GetZipballURL() string { + if r == nil || r.ZipballURL == nil { + return "" + } + return *r.ZipballURL +} + +// GetParameters returns the Parameters field if it's non-nil, zero value otherwise. +func (r *RepositoryRule) GetParameters() json.RawMessage { + if r == nil || r.Parameters == nil { + return json.RawMessage{} + } + return *r.Parameters +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + +// GetCurrentUserCanBypass returns the CurrentUserCanBypass field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetCurrentUserCanBypass() string { + if r == nil || r.CurrentUserCanBypass == nil { + return "" + } + return *r.CurrentUserCanBypass +} + +// GetLinks returns the Links field. +func (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLink { + if r == nil { + return nil + } + return r.Links +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + +// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetSourceType() string { + if r == nil || r.SourceType == nil { + return "" + } + return *r.SourceType +} + +// GetTarget returns the Target field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetTarget() string { + if r == nil || r.Target == nil { + return "" + } + return *r.Target +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (r *RepositoryRuleset) GetUpdatedAt() Timestamp { + if r == nil || r.UpdatedAt == nil { + return Timestamp{} + } + return *r.UpdatedAt +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetCodeScanningRule) GetParameters() *RuleCodeScanningParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetConditions returns the Conditions field. +func (r *RepositoryRulesetEditedChanges) GetConditions() *RepositoryRulesetEditedConditions { + if r == nil { + return nil + } + return r.Conditions +} + +// GetEnforcement returns the Enforcement field. +func (r *RepositoryRulesetEditedChanges) GetEnforcement() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.Enforcement +} + +// GetName returns the Name field. +func (r *RepositoryRulesetEditedChanges) GetName() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.Name +} + +// GetRules returns the Rules field. +func (r *RepositoryRulesetEditedChanges) GetRules() *RepositoryRulesetEditedRules { + if r == nil { + return nil + } + return r.Rules +} + +// GetConfiguration returns the Configuration field. +func (r *RepositoryRulesetEditedRuleChanges) GetConfiguration() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Configuration +} + +// GetPattern returns the Pattern field. +func (r *RepositoryRulesetEditedRuleChanges) GetPattern() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Pattern +} + +// GetRuleType returns the RuleType field. +func (r *RepositoryRulesetEditedRuleChanges) GetRuleType() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.RuleType +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetEditedSource) GetFrom() string { + if r == nil || r.From == nil { + return "" + } + return *r.From +} + +// GetChanges returns the Changes field. +func (r *RepositoryRulesetEditedUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedConditionsEdited { + if r == nil { + return nil + } + return r.Changes +} + +// GetCondition returns the Condition field. +func (r *RepositoryRulesetEditedUpdatedConditions) GetCondition() *RepositoryRulesetRefCondition { + if r == nil { + return nil + } + return r.Condition +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (r *RepositoryRulesetEvent) GetAction() string { + if r == nil || r.Action == nil { + return "" + } + return *r.Action +} + +// GetChanges returns the Changes field. +func (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetEditedChanges { + if r == nil { + return nil + } + return r.Changes +} + +// GetEnterprise returns the Enterprise field. +func (r *RepositoryRulesetEvent) GetEnterprise() *Enterprise { + if r == nil { + return nil + } + return r.Enterprise +} + +// GetInstallation returns the Installation field. +func (r *RepositoryRulesetEvent) GetInstallation() *Installation { + if r == nil { + return nil + } + return r.Installation +} + +// GetOrganization returns the Organization field. +func (r *RepositoryRulesetEvent) GetOrganization() *Organization { + if r == nil { + return nil + } + return r.Organization +} + +// GetRepository returns the Repository field. +func (r *RepositoryRulesetEvent) GetRepository() *Repository { + if r == nil { + return nil + } + return r.Repository +} + +// GetRepositoryRuleset returns the RepositoryRuleset field. +func (r *RepositoryRulesetEvent) GetRepositoryRuleset() *RepositoryRuleset { + if r == nil { + return nil + } + return r.RepositoryRuleset +} + +// GetSender returns the Sender field. +func (r *RepositoryRulesetEvent) GetSender() *User { + if r == nil { + return nil + } + return r.Sender +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetFileExtensionRestrictionRule) GetParameters() *RuleFileExtensionRestrictionParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetFilePathRestrictionRule) GetParameters() *RuleFileParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetHTML returns the HTML field. +func (r *RepositoryRulesetLink) GetHTML() *RulesetLink { + if r == nil { + return nil + } + return r.HTML +} + +// GetSelf returns the Self field. +func (r *RepositoryRulesetLink) GetSelf() *RulesetLink { + if r == nil { + return nil + } + return r.Self +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetMaxFilePathLengthRule) GetParameters() *RuleMaxFilePathLengthParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetMaxFileSizeRule) GetParameters() *RuleMaxFileSizeParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetMergeQueueRule) GetParameters() *MergeQueueRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetPatternRule) GetParameters() *RulePatternParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetPullRequestRule) GetParameters() *PullRequestRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetRefName returns the RefName field. +func (r *RepositoryRulesetRefCondition) GetRefName() *RulesetRefConditionParameters { + if r == nil { + return nil + } + return r.RefName +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetRequiredDeploymentsRule) GetParameters() *RequiredDeploymentEnvironmentsRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetRequiredStatusChecksRule) GetParameters() *RequiredStatusChecksRuleParameters { + if r == nil { + return nil + } + return r.Parameters +} + +// GetBranchNamePattern returns the BranchNamePattern field. +func (r *RepositoryRulesetRule) GetBranchNamePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.BranchNamePattern +} + +// GetCodeScanning returns the CodeScanning field. +func (r *RepositoryRulesetRule) GetCodeScanning() *RepositoryRulesetCodeScanningRule { + if r == nil { + return nil + } + return r.CodeScanning +} + +// GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern field. +func (r *RepositoryRulesetRule) GetCommitAuthorEmailPattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.CommitAuthorEmailPattern +} + +// GetCommitMessagePattern returns the CommitMessagePattern field. +func (r *RepositoryRulesetRule) GetCommitMessagePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.CommitMessagePattern +} + +// GetCommitterEmailPattern returns the CommitterEmailPattern field. +func (r *RepositoryRulesetRule) GetCommitterEmailPattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.CommitterEmailPattern +} + +// GetCreation returns the Creation field. +func (r *RepositoryRulesetRule) GetCreation() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.Creation +} + +// GetDeletion returns the Deletion field. +func (r *RepositoryRulesetRule) GetDeletion() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.Deletion +} + +// GetFileExtensionRestriction returns the FileExtensionRestriction field. +func (r *RepositoryRulesetRule) GetFileExtensionRestriction() *RepositoryRulesetFileExtensionRestrictionRule { + if r == nil { + return nil + } + return r.FileExtensionRestriction +} + +// GetFilePathRestriction returns the FilePathRestriction field. +func (r *RepositoryRulesetRule) GetFilePathRestriction() *RepositoryRulesetFilePathRestrictionRule { + if r == nil { + return nil + } + return r.FilePathRestriction +} + +// GetMaxFilePathLength returns the MaxFilePathLength field. +func (r *RepositoryRulesetRule) GetMaxFilePathLength() *RepositoryRulesetMaxFilePathLengthRule { + if r == nil { + return nil + } + return r.MaxFilePathLength +} + +// GetMaxFileSize returns the MaxFileSize field. +func (r *RepositoryRulesetRule) GetMaxFileSize() *RepositoryRulesetMaxFileSizeRule { + if r == nil { + return nil + } + return r.MaxFileSize } -// GetDiscussionCategoryName returns the DiscussionCategoryName field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetDiscussionCategoryName() string { - if r == nil || r.DiscussionCategoryName == nil { - return "" +// GetMergeQueue returns the MergeQueue field. +func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule { + if r == nil { + return nil } - return *r.DiscussionCategoryName + return r.MergeQueue } -// GetDraft returns the Draft field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetDraft() bool { - if r == nil || r.Draft == nil { - return false +// GetNonFastForward returns the NonFastForward field. +func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { + if r == nil { + return nil } - return *r.Draft + return r.NonFastForward } -// GetGenerateReleaseNotes returns the GenerateReleaseNotes field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetGenerateReleaseNotes() bool { - if r == nil || r.GenerateReleaseNotes == nil { - return false +// GetPullRequest returns the PullRequest field. +func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRule { + if r == nil { + return nil } - return *r.GenerateReleaseNotes + return r.PullRequest } -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetHTMLURL() string { - if r == nil || r.HTMLURL == nil { - return "" +// GetRequiredDeployments returns the RequiredDeployments field. +func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequiredDeploymentsRule { + if r == nil { + return nil } - return *r.HTMLURL + return r.RequiredDeployments } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetID() int64 { - if r == nil || r.ID == nil { - return 0 +// GetRequiredLinearHistory returns the RequiredLinearHistory field. +func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRuleType { + if r == nil { + return nil } - return *r.ID + return r.RequiredLinearHistory } -// GetMakeLatest returns the MakeLatest field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetMakeLatest() string { - if r == nil || r.MakeLatest == nil { - return "" +// GetRequiredSignatures returns the RequiredSignatures field. +func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleType { + if r == nil { + return nil } - return *r.MakeLatest + return r.RequiredSignatures } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetName() string { - if r == nil || r.Name == nil { - return "" +// GetRequiredStatusChecks returns the RequiredStatusChecks field. +func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequiredStatusChecksRule { + if r == nil { + return nil } - return *r.Name + return r.RequiredStatusChecks } -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetNodeID() string { - if r == nil || r.NodeID == nil { - return "" +// GetTagNamePattern returns the TagNamePattern field. +func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil } - return *r.NodeID + return r.TagNamePattern } -// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetPrerelease() bool { - if r == nil || r.Prerelease == nil { - return false +// GetUpdate returns the Update field. +func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { + if r == nil { + return nil } - return *r.Prerelease + return r.Update } -// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetPublishedAt() Timestamp { - if r == nil || r.PublishedAt == nil { - return Timestamp{} +// GetWorkflows returns the Workflows field. +func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { + if r == nil { + return nil } - return *r.PublishedAt + return r.Workflows } -// GetTagName returns the TagName field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetTagName() string { - if r == nil || r.TagName == nil { - return "" +// GetConditionType returns the ConditionType field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *RepositoryRulesetEditedSource { + if r == nil { + return nil } - return *r.TagName + return r.ConditionType } -// GetTarballURL returns the TarballURL field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetTarballURL() string { - if r == nil || r.TarballURL == nil { - return "" +// GetExclude returns the Exclude field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRulesetEditedSources { + if r == nil { + return nil } - return *r.TarballURL + return r.Exclude } -// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetTargetCommitish() string { - if r == nil || r.TargetCommitish == nil { - return "" +// GetInclude returns the Include field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRulesetEditedSources { + if r == nil { + return nil } - return *r.TargetCommitish + return r.Include } -// GetUploadURL returns the UploadURL field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetUploadURL() string { - if r == nil || r.UploadURL == nil { - return "" +// GetTarget returns the Target field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulesetEditedSource { + if r == nil { + return nil } - return *r.UploadURL + return r.Target } -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetURL() string { - if r == nil || r.URL == nil { - return "" +// GetChanges returns the Changes field. +func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetEditedRuleChanges { + if r == nil { + return nil } - return *r.URL + return r.Changes } -// GetZipballURL returns the ZipballURL field if it's non-nil, zero value otherwise. -func (r *RepositoryRelease) GetZipballURL() string { - if r == nil || r.ZipballURL == nil { - return "" +// GetRule returns the Rule field. +func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRulesetRule { + if r == nil { + return nil } - return *r.ZipballURL + return r.Rule } -// GetParameters returns the Parameters field if it's non-nil, zero value otherwise. -func (r *RepositoryRule) GetParameters() json.RawMessage { - if r == nil || r.Parameters == nil { - return json.RawMessage{} +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetUpdateRule) GetParameters() *UpdateAllowsFetchAndMergeRuleParameters { + if r == nil { + return nil } - return *r.Parameters + return r.Parameters +} + +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetWorkflowsRule) GetParameters() *RequiredWorkflowsRuleParameters { + if r == nil { + return nil + } + return r.Parameters } // GetCommit returns the Commit field. @@ -20798,6 +21838,14 @@ func (r *RequiredStatusChecksRequest) GetStrict() bool { return *r.Strict } +// GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { + if r == nil || r.DoNotEnforceOnCreate == nil { + return false + } + return *r.DoNotEnforceOnCreate +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (r *RequiredWorkflowSelectedRepos) GetTotalCount() int { if r == nil || r.TotalCount == nil { @@ -20942,6 +21990,14 @@ func (r *Ruleset) GetConditions() *RulesetConditions { return r.Conditions } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetCreatedAt() Timestamp { + if r == nil || r.CreatedAt == nil { + return Timestamp{} + } + return *r.CreatedAt +} + // GetID returns the ID field if it's non-nil, zero value otherwise. func (r *Ruleset) GetID() int64 { if r == nil || r.ID == nil { @@ -20982,6 +22038,14 @@ func (r *Ruleset) GetTarget() string { return *r.Target } +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (r *Ruleset) GetUpdatedAt() Timestamp { + if r == nil || r.UpdatedAt == nil { + return Timestamp{} + } + return *r.UpdatedAt +} + // GetRefName returns the RefName field. func (r *RulesetConditions) GetRefName() *RulesetRefConditionParameters { if r == nil { @@ -21038,6 +22102,14 @@ func (r *RulesetRepositoryNamesConditionParameters) GetProtected() bool { return *r.Protected } +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (r *RulesetRepositoryPropertyTargetParameters) GetSource() string { + if r == nil || r.Source == nil { + return "" + } + return *r.Source +} + // GetBusy returns the Busy field if it's non-nil, zero value otherwise. func (r *Runner) GetBusy() bool { if r == nil || r.Busy == nil { @@ -21902,6 +22974,62 @@ func (s *SecretScanningAlertLocationDetails) GetStartline() int { return *s.Startline } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertLocationEvent) GetAction() string { + if s == nil || s.Action == nil { + return "" + } + return *s.Action +} + +// GetAlert returns the Alert field. +func (s *SecretScanningAlertLocationEvent) GetAlert() *SecretScanningAlert { + if s == nil { + return nil + } + return s.Alert +} + +// GetInstallation returns the Installation field. +func (s *SecretScanningAlertLocationEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetLocation returns the Location field. +func (s *SecretScanningAlertLocationEvent) GetLocation() *SecretScanningAlertLocation { + if s == nil { + return nil + } + return s.Location +} + +// GetOrganization returns the Organization field. +func (s *SecretScanningAlertLocationEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepo returns the Repo field. +func (s *SecretScanningAlertLocationEvent) GetRepo() *Repository { + if s == nil { + return nil + } + return s.Repo +} + +// GetSender returns the Sender field. +func (s *SecretScanningAlertLocationEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + // GetResolution returns the Resolution field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertUpdateOptions) GetResolution() string { if s == nil || s.Resolution == nil { @@ -25406,6 +26534,70 @@ func (w *WorkflowJobEvent) GetWorkflowJob() *WorkflowJob { return w.WorkflowJob } +// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetConclusion() string { + if w == nil || w.Conclusion == nil { + return "" + } + return *w.Conclusion +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetCreatedAt() Timestamp { + if w == nil || w.CreatedAt == nil { + return Timestamp{} + } + return *w.CreatedAt +} + +// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetEnvironment() string { + if w == nil || w.Environment == nil { + return "" + } + return *w.Environment +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetHTMLURL() string { + if w == nil || w.HTMLURL == nil { + return "" + } + return *w.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetID() int64 { + if w == nil || w.ID == nil { + return 0 + } + return *w.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetName() string { + if w == nil || w.Name == nil { + return "" + } + return *w.Name +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetStatus() string { + if w == nil || w.Status == nil { + return "" + } + return *w.Status +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (w *WorkflowJobRun) GetUpdatedAt() Timestamp { + if w == nil || w.UpdatedAt == nil { + return Timestamp{} + } + return *w.UpdatedAt +} + // GetActor returns the Actor field. func (w *WorkflowRun) GetActor() *User { if w == nil { diff --git a/vendor/github.com/google/go-github/v65/github/github.go b/vendor/github.com/google/go-github/v66/github/github.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/github.go rename to vendor/github.com/google/go-github/v66/github/github.go index cceaec03d4..042a0b52e7 100644 --- a/vendor/github.com/google/go-github/v65/github/github.go +++ b/vendor/github.com/google/go-github/v66/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v65.0.0" + Version = "v66.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" @@ -774,7 +774,7 @@ func parseSecondaryRate(r *http.Response) *time.Duration { // According to GitHub support, endpoints might return x-ratelimit-reset instead, // as an integer which represents the number of seconds since epoch UTC, - // represting the time to resume making requests. + // representing the time to resume making requests. if v := r.Header.Get(headerRateReset); v != "" { secondsSinceEpoch, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop. retryAfter := time.Until(time.Unix(secondsSinceEpoch, 0)) @@ -1595,7 +1595,7 @@ func Int64(v int64) *int64 { return &v } // to store v and returns a pointer to it. func String(v string) *string { return &v } -// roundTripperFunc creates a RoundTripper (transport) +// roundTripperFunc creates a RoundTripper (transport). type roundTripperFunc func(*http.Request) (*http.Response, error) func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/gitignore.go b/vendor/github.com/google/go-github/v66/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/gitignore.go rename to vendor/github.com/google/go-github/v66/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v65/github/interactions.go b/vendor/github.com/google/go-github/v66/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/interactions.go rename to vendor/github.com/google/go-github/v66/github/interactions.go diff --git a/vendor/github.com/google/go-github/v65/github/interactions_orgs.go b/vendor/github.com/google/go-github/v66/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v66/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v65/github/interactions_repos.go b/vendor/github.com/google/go-github/v66/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/interactions_repos.go rename to vendor/github.com/google/go-github/v66/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v65/github/issue_import.go b/vendor/github.com/google/go-github/v66/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issue_import.go rename to vendor/github.com/google/go-github/v66/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v65/github/issues.go b/vendor/github.com/google/go-github/v66/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issues.go rename to vendor/github.com/google/go-github/v66/github/issues.go diff --git a/vendor/github.com/google/go-github/v65/github/issues_assignees.go b/vendor/github.com/google/go-github/v66/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issues_assignees.go rename to vendor/github.com/google/go-github/v66/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v65/github/issues_comments.go b/vendor/github.com/google/go-github/v66/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issues_comments.go rename to vendor/github.com/google/go-github/v66/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v65/github/issues_events.go b/vendor/github.com/google/go-github/v66/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issues_events.go rename to vendor/github.com/google/go-github/v66/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v65/github/issues_labels.go b/vendor/github.com/google/go-github/v66/github/issues_labels.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/issues_labels.go rename to vendor/github.com/google/go-github/v66/github/issues_labels.go index 51e7fe6a55..b97b00f3e8 100644 --- a/vendor/github.com/google/go-github/v65/github/issues_labels.go +++ b/vendor/github.com/google/go-github/v66/github/issues_labels.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// Label represents a GitHub label on an Issue +// Label represents a GitHub label on an Issue. type Label struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` diff --git a/vendor/github.com/google/go-github/v65/github/issues_milestones.go b/vendor/github.com/google/go-github/v66/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issues_milestones.go rename to vendor/github.com/google/go-github/v66/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v65/github/issues_timeline.go b/vendor/github.com/google/go-github/v66/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/issues_timeline.go rename to vendor/github.com/google/go-github/v66/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v65/github/licenses.go b/vendor/github.com/google/go-github/v66/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/licenses.go rename to vendor/github.com/google/go-github/v66/github/licenses.go diff --git a/vendor/github.com/google/go-github/v65/github/markdown.go b/vendor/github.com/google/go-github/v66/github/markdown.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/markdown.go rename to vendor/github.com/google/go-github/v66/github/markdown.go diff --git a/vendor/github.com/google/go-github/v65/github/messages.go b/vendor/github.com/google/go-github/v66/github/messages.go similarity index 69% rename from vendor/github.com/google/go-github/v65/github/messages.go rename to vendor/github.com/google/go-github/v66/github/messages.go index 0385d398bd..608c557cb0 100644 --- a/vendor/github.com/google/go-github/v65/github/messages.go +++ b/vendor/github.com/google/go-github/v66/github/messages.go @@ -46,76 +46,80 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. eventTypeMapping = map[string]interface{}{ - "branch_protection_rule": &BranchProtectionRuleEvent{}, - "check_run": &CheckRunEvent{}, - "check_suite": &CheckSuiteEvent{}, - "code_scanning_alert": &CodeScanningAlertEvent{}, - "commit_comment": &CommitCommentEvent{}, - "content_reference": &ContentReferenceEvent{}, - "create": &CreateEvent{}, - "delete": &DeleteEvent{}, - "dependabot_alert": &DependabotAlertEvent{}, - "deploy_key": &DeployKeyEvent{}, - "deployment": &DeploymentEvent{}, - "deployment_status": &DeploymentStatusEvent{}, - "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, - "discussion": &DiscussionEvent{}, - "discussion_comment": &DiscussionCommentEvent{}, - "fork": &ForkEvent{}, - "github_app_authorization": &GitHubAppAuthorizationEvent{}, - "gollum": &GollumEvent{}, - "installation": &InstallationEvent{}, - "installation_repositories": &InstallationRepositoriesEvent{}, - "installation_target": &InstallationTargetEvent{}, - "issue_comment": &IssueCommentEvent{}, - "issues": &IssuesEvent{}, - "label": &LabelEvent{}, - "marketplace_purchase": &MarketplacePurchaseEvent{}, - "member": &MemberEvent{}, - "membership": &MembershipEvent{}, - "merge_group": &MergeGroupEvent{}, - "meta": &MetaEvent{}, - "milestone": &MilestoneEvent{}, - "organization": &OrganizationEvent{}, - "org_block": &OrgBlockEvent{}, - "package": &PackageEvent{}, - "page_build": &PageBuildEvent{}, - "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, - "ping": &PingEvent{}, - "project": &ProjectEvent{}, - "project_card": &ProjectCardEvent{}, - "project_column": &ProjectColumnEvent{}, - "projects_v2": &ProjectV2Event{}, - "projects_v2_item": &ProjectV2ItemEvent{}, - "public": &PublicEvent{}, - "pull_request": &PullRequestEvent{}, - "pull_request_review": &PullRequestReviewEvent{}, - "pull_request_review_comment": &PullRequestReviewCommentEvent{}, - "pull_request_review_thread": &PullRequestReviewThreadEvent{}, - "pull_request_target": &PullRequestTargetEvent{}, - "push": &PushEvent{}, - "repository": &RepositoryEvent{}, - "repository_dispatch": &RepositoryDispatchEvent{}, - "repository_import": &RepositoryImportEvent{}, - "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, - "release": &ReleaseEvent{}, - "secret_scanning_alert": &SecretScanningAlertEvent{}, - "security_advisory": &SecurityAdvisoryEvent{}, - "security_and_analysis": &SecurityAndAnalysisEvent{}, - "sponsorship": &SponsorshipEvent{}, - "star": &StarEvent{}, - "status": &StatusEvent{}, - "team": &TeamEvent{}, - "team_add": &TeamAddEvent{}, - "user": &UserEvent{}, - "watch": &WatchEvent{}, - "workflow_dispatch": &WorkflowDispatchEvent{}, - "workflow_job": &WorkflowJobEvent{}, - "workflow_run": &WorkflowRunEvent{}, + "branch_protection_configuration": &BranchProtectionConfigurationEvent{}, + "branch_protection_rule": &BranchProtectionRuleEvent{}, + "check_run": &CheckRunEvent{}, + "check_suite": &CheckSuiteEvent{}, + "code_scanning_alert": &CodeScanningAlertEvent{}, + "commit_comment": &CommitCommentEvent{}, + "content_reference": &ContentReferenceEvent{}, + "create": &CreateEvent{}, + "delete": &DeleteEvent{}, + "dependabot_alert": &DependabotAlertEvent{}, + "deploy_key": &DeployKeyEvent{}, + "deployment": &DeploymentEvent{}, + "deployment_review": &DeploymentReviewEvent{}, + "deployment_status": &DeploymentStatusEvent{}, + "deployment_protection_rule": &DeploymentProtectionRuleEvent{}, + "discussion": &DiscussionEvent{}, + "discussion_comment": &DiscussionCommentEvent{}, + "fork": &ForkEvent{}, + "github_app_authorization": &GitHubAppAuthorizationEvent{}, + "gollum": &GollumEvent{}, + "installation": &InstallationEvent{}, + "installation_repositories": &InstallationRepositoriesEvent{}, + "installation_target": &InstallationTargetEvent{}, + "issue_comment": &IssueCommentEvent{}, + "issues": &IssuesEvent{}, + "label": &LabelEvent{}, + "marketplace_purchase": &MarketplacePurchaseEvent{}, + "member": &MemberEvent{}, + "membership": &MembershipEvent{}, + "merge_group": &MergeGroupEvent{}, + "meta": &MetaEvent{}, + "milestone": &MilestoneEvent{}, + "organization": &OrganizationEvent{}, + "org_block": &OrgBlockEvent{}, + "package": &PackageEvent{}, + "page_build": &PageBuildEvent{}, + "personal_access_token_request": &PersonalAccessTokenRequestEvent{}, + "ping": &PingEvent{}, + "project": &ProjectEvent{}, + "project_card": &ProjectCardEvent{}, + "project_column": &ProjectColumnEvent{}, + "projects_v2": &ProjectV2Event{}, + "projects_v2_item": &ProjectV2ItemEvent{}, + "public": &PublicEvent{}, + "pull_request": &PullRequestEvent{}, + "pull_request_review": &PullRequestReviewEvent{}, + "pull_request_review_comment": &PullRequestReviewCommentEvent{}, + "pull_request_review_thread": &PullRequestReviewThreadEvent{}, + "pull_request_target": &PullRequestTargetEvent{}, + "push": &PushEvent{}, + "repository": &RepositoryEvent{}, + "repository_dispatch": &RepositoryDispatchEvent{}, + "repository_import": &RepositoryImportEvent{}, + "repository_ruleset": &RepositoryRulesetEvent{}, + "repository_vulnerability_alert": &RepositoryVulnerabilityAlertEvent{}, + "release": &ReleaseEvent{}, + "secret_scanning_alert": &SecretScanningAlertEvent{}, + "secret_scanning_alert_location": &SecretScanningAlertLocationEvent{}, + "security_advisory": &SecurityAdvisoryEvent{}, + "security_and_analysis": &SecurityAndAnalysisEvent{}, + "sponsorship": &SponsorshipEvent{}, + "star": &StarEvent{}, + "status": &StatusEvent{}, + "team": &TeamEvent{}, + "team_add": &TeamAddEvent{}, + "user": &UserEvent{}, + "watch": &WatchEvent{}, + "workflow_dispatch": &WorkflowDispatchEvent{}, + "workflow_job": &WorkflowJobEvent{}, + "workflow_run": &WorkflowRunEvent{}, } - // forward mapping of event types to the string names of the structs + // Forward mapping of event types to the string names of the structs. messageToTypeName = make(map[string]string, len(eventTypeMapping)) - // Inverse map of the above + // Inverse map of the above. typeToMessageMapping = make(map[string]string, len(eventTypeMapping)) ) diff --git a/vendor/github.com/google/go-github/v65/github/meta.go b/vendor/github.com/google/go-github/v66/github/meta.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/meta.go rename to vendor/github.com/google/go-github/v66/github/meta.go diff --git a/vendor/github.com/google/go-github/v65/github/migrations.go b/vendor/github.com/google/go-github/v66/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/migrations.go rename to vendor/github.com/google/go-github/v66/github/migrations.go diff --git a/vendor/github.com/google/go-github/v65/github/migrations_source_import.go b/vendor/github.com/google/go-github/v66/github/migrations_source_import.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v66/github/migrations_source_import.go index 3b161232f6..f484b77d47 100644 --- a/vendor/github.com/google/go-github/v65/github/migrations_source_import.go +++ b/vendor/github.com/google/go-github/v66/github/migrations_source_import.go @@ -76,7 +76,7 @@ type Import struct { // Contact GitHub support for more information. // detection_needs_auth - the importer requires authentication for // the originating repository to continue detection. Make an - // UpdatImport request, and include VCSUsername and + // UpdateImport request, and include VCSUsername and // VCSPassword. // detection_found_nothing - the importer didn't recognize any // source control at the URL. diff --git a/vendor/github.com/google/go-github/v65/github/migrations_user.go b/vendor/github.com/google/go-github/v66/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/migrations_user.go rename to vendor/github.com/google/go-github/v66/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs.go b/vendor/github.com/google/go-github/v66/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs.go rename to vendor/github.com/google/go-github/v66/github/orgs.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v66/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v66/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v66/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v66/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_attestations.go b/vendor/github.com/google/go-github/v66/github/orgs_attestations.go new file mode 100644 index 0000000000..3d5793c18f --- /dev/null +++ b/vendor/github.com/google/go-github/v66/github/orgs_attestations.go @@ -0,0 +1,40 @@ +// Copyright 2024 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" +) + +// ListAttestations returns a collection of artifact attestations +// with a given subject digest that are associated with repositories +// owned by an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-attestations +// +//meta:operation GET /orgs/{org}/attestations/{subject_digest} +func (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { + var u = fmt.Sprintf("orgs/%v/attestations/%v", org, subjectDigest) + + 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 attestations *AttestationsResponse + resp, err := s.client.Do(ctx, req, &attestations) + if err != nil { + return nil, resp, err + } + + return attestations, resp, nil +} diff --git a/vendor/github.com/google/go-github/v65/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v66/github/orgs_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v66/github/orgs_audit_log.go diff --git a/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go new file mode 100644 index 0000000000..b25845a4e8 --- /dev/null +++ b/vendor/github.com/google/go-github/v66/github/orgs_codesecurity_configurations.go @@ -0,0 +1,284 @@ +// Copyright 2024 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" + "net/http" +) + +// DependencyGraphAutosubmitActionOptions represents the options for the DependencyGraphAutosubmitAction. +type DependencyGraphAutosubmitActionOptions struct { + LabeledRunners *bool `json:"labeled_runners,omitempty"` +} + +// CodeSecurityConfiguration represents a code security configuration. +type CodeSecurityConfiguration struct { + ID *int64 `json:"id,omitempty"` + TargetType *string `json:"target_type,omitempty"` + Name *string `json:"name"` + Description *string `json:"description,omitempty"` + AdvancedSecurity *string `json:"advanced_security,omitempty"` + DependencyGraph *string `json:"dependency_graph,omitempty"` + DependencyGraphAutosubmitAction *string `json:"dependency_graph_autosubmit_action,omitempty"` + DependencyGraphAutosubmitActionOptions *DependencyGraphAutosubmitActionOptions `json:"dependency_graph_autosubmit_action_options,omitempty"` + DependabotAlerts *string `json:"dependabot_alerts,omitempty"` + DependabotSecurityUpdates *string `json:"dependabot_security_updates,omitempty"` + CodeScanningDefaultSetup *string `json:"code_scanning_default_setup,omitempty"` + SecretScanning *string `json:"secret_scanning,omitempty"` + SecretScanningPushProtection *string `json:"secret_scanning_push_protection,omitempty"` + SecretScanningValidityChecks *string `json:"secret_scanning_validity_checks,omitempty"` + SecretScanningNonProviderPatterns *string `json:"secret_scanning_non_provider_patterns,omitempty"` + PrivateVulnerabilityReporting *string `json:"private_vulnerability_reporting,omitempty"` + Enforcement *string `json:"enforcement,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// CodeSecurityConfigurationWithDefaultForNewRepos represents a code security configuration with default for new repos param. +type CodeSecurityConfigurationWithDefaultForNewRepos struct { + Configuration *CodeSecurityConfiguration `json:"configuration"` + DefaultForNewRepos *string `json:"default_for_new_repos"` +} + +// RepositoryCodeSecurityConfiguration represents a code security configuration for a repository. +type RepositoryCodeSecurityConfiguration struct { + State *string `json:"state,omitempty"` + Configuration *CodeSecurityConfiguration `json:"configuration,omitempty"` +} + +// GetCodeSecurityConfigurations gets code security configurations for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization +// +//meta:operation GET /orgs/{org}/code-security/configurations +func (s *OrganizationsService) GetCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var configurations []*CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// CreateCodeSecurityConfiguration creates a code security configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration +// +//meta:operation POST /orgs/{org}/code-security/configurations +func (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Context, org string, c *CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations", org) + + req, err := s.client.NewRequest("POST", u, c) + if err != nil { + return nil, nil, err + } + + var configuration *CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// GetDefaultCodeSecurityConfigurations gets default code security configurations for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations +// +//meta:operation GET /orgs/{org}/code-security/configurations/defaults +func (s *OrganizationsService) GetDefaultCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/defaults", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var configurations []*CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// DetachCodeSecurityConfigurationsFromRepositories detaches code security configuration from an organization's repositories. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories +// +//meta:operation DELETE /orgs/{org}/code-security/configurations/detach +func (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories(ctx context.Context, org string, repoIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/detach", org) + type selectedRepoIDs struct { + SelectedIDs []int64 `json:"selected_repository_ids"` + } + req, err := s.client.NewRequest("DELETE", u, selectedRepoIDs{SelectedIDs: repoIDs}) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + return resp, nil +} + +// GetCodeSecurityConfiguration gets a code security configuration available in an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration +// +//meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id} +func (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, org string, id int64) (*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, id) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var configuration *CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// UpdateCodeSecurityConfiguration updates a code security configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration +// +//meta:operation PATCH /orgs/{org}/code-security/configurations/{configuration_id} +func (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Context, org string, id int64, c *CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, id) + + req, err := s.client.NewRequest("PATCH", u, c) + if err != nil { + return nil, nil, err + } + + var configuration *CodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// DeleteCodeSecurityConfiguration deletes a code security configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration +// +//meta:operation DELETE /orgs/{org}/code-security/configurations/{configuration_id} +func (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Context, org string, id int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v", org, id) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + return resp, nil +} + +// AttachCodeSecurityConfigurationsToRepositories attaches code security configurations to repositories for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories +// +//meta:operation POST /orgs/{org}/code-security/configurations/{configuration_id}/attach +func (s *OrganizationsService) AttachCodeSecurityConfigurationsToRepositories(ctx context.Context, org string, id int64, scope string, repoIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v/attach", org, id) + type selectedRepoIDs struct { + Scope string `json:"scope"` + SelectedIDs []int64 `json:"selected_repository_ids,omitempty"` + } + req, err := s.client.NewRequest("POST", u, selectedRepoIDs{Scope: scope, SelectedIDs: repoIDs}) + if err != nil { + return nil, err + } + resp, err := s.client.Do(ctx, req, nil) + if err != nil && resp.StatusCode != http.StatusAccepted { // StatusAccepted(202) is the expected status code as job is queued for processing + return resp, err + } + return resp, nil +} + +// SetDefaultCodeSecurityConfiguration sets a code security configuration as the default for an organization. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization +// +//meta:operation PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults +func (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.Context, org string, id int64, newReposParam string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v/defaults", org, id) + type configParam struct { + DefaultForNewRepos string `json:"default_for_new_repos"` + } + req, err := s.client.NewRequest("PUT", u, configParam{DefaultForNewRepos: newReposParam}) + if err != nil { + return nil, nil, err + } + var c *CodeSecurityConfigurationWithDefaultForNewRepos + resp, err := s.client.Do(ctx, req, &c) + if err != nil { + return nil, resp, err + } + return c, resp, nil +} + +// GetRepositoriesForCodeSecurityConfiguration gets repositories associated with a code security configuration. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration +// +//meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories +func (s *OrganizationsService) GetRepositoriesForCodeSecurityConfiguration(ctx context.Context, org string, id int64) ([]*Repository, *Response, error) { + u := fmt.Sprintf("orgs/%v/code-security/configurations/%v/repositories", org, id) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var repositories []*Repository + resp, err := s.client.Do(ctx, req, &repositories) + if err != nil { + return nil, resp, err + } + return repositories, resp, nil +} + +// GetCodeSecurityConfigurationForRepository gets code security configuration that manages a repository's code security settings. +// +// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/code-security-configuration +func (s *OrganizationsService) GetCodeSecurityConfigurationForRepository(ctx context.Context, org, repo string) (*RepositoryCodeSecurityConfiguration, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-security-configuration", org, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + var repoConfig *RepositoryCodeSecurityConfiguration + resp, err := s.client.Do(ctx, req, &repoConfig) + if err != nil { + return nil, resp, err + } + return repoConfig, resp, nil +} diff --git a/vendor/github.com/google/go-github/v65/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v66/github/orgs_credential_authorizations.go similarity index 83% rename from vendor/github.com/google/go-github/v65/github/orgs_credential_authorizations.go rename to vendor/github.com/google/go-github/v66/github/orgs_credential_authorizations.go index eed0f0c66e..dca42433c3 100644 --- a/vendor/github.com/google/go-github/v65/github/orgs_credential_authorizations.go +++ b/vendor/github.com/google/go-github/v66/github/orgs_credential_authorizations.go @@ -55,13 +55,23 @@ type CredentialAuthorization struct { AuthorizedCredentialExpiresAt *Timestamp `json:"authorized_credential_expires_at,omitempty"` } +// CredentialAuthorizationsListOptions adds the Login option as supported by the +// list SAML SSO authorizations for organizations endpoint alongside paging options +// such as Page and PerPage. +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization +type CredentialAuthorizationsListOptions struct { + ListOptions + // For credentials authorizations for an organization, limit the list of authorizations to a specific login (aka github username) + Login string `url:"login,omitempty"` +} + // ListCredentialAuthorizations lists credentials authorized through SAML SSO // for a given organization. Only available with GitHub Enterprise Cloud. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization // //meta:operation GET /orgs/{org}/credential-authorizations -func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *ListOptions) ([]*CredentialAuthorization, *Response, error) { +func (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) ([]*CredentialAuthorization, *Response, error) { u := fmt.Sprintf("orgs/%v/credential-authorizations", org) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go b/vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go new file mode 100644 index 0000000000..2295e1b8a7 --- /dev/null +++ b/vendor/github.com/google/go-github/v66/github/orgs_custom_repository_roles.go @@ -0,0 +1,131 @@ +// Copyright 2024 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" +) + +// OrganizationCustomRepoRoles represents custom repository roles available in specified organization. +type OrganizationCustomRepoRoles struct { + TotalCount *int `json:"total_count,omitempty"` + CustomRepoRoles []*CustomRepoRoles `json:"custom_roles,omitempty"` +} + +// CustomRepoRoles represents custom repository roles for an organization. +// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization +// for more information. +type CustomRepoRoles struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Org *Organization `json:"organization,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. +type CreateOrUpdateCustomRepoRoleOptions struct { + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + BaseRole *string `json:"base_role,omitempty"` + Permissions []string `json:"permissions"` +} + +// ListCustomRepoRoles lists the custom repository roles available in this organization. +// In order to see custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// +//meta:operation GET /orgs/{org}/custom-repository-roles +func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + customRepoRoles := new(OrganizationCustomRepoRoles) + resp, err := s.client.Do(ctx, req, customRepoRoles) + if err != nil { + return nil, resp, err + } + + return customRepoRoles, resp, nil +} + +// CreateCustomRepoRole creates a custom repository role in this organization. +// In order to create custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// +//meta:operation POST /orgs/{org}/custom-repository-roles +func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// UpdateCustomRepoRole updates a custom repository role in this organization. +// In order to update custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// +//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} +func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + +// DeleteCustomRepoRole deletes an existing custom repository role in this organization. +// In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// +//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} +func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resultingRole := new(CustomRepoRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/vendor/github.com/google/go-github/v65/github/orgs_hooks.go b/vendor/github.com/google/go-github/v66/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v66/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v66/github/orgs_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_hooks_configuration.go rename to vendor/github.com/google/go-github/v66/github/orgs_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v66/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v66/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_members.go b/vendor/github.com/google/go-github/v66/github/orgs_members.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/orgs_members.go rename to vendor/github.com/google/go-github/v66/github/orgs_members.go index 5bc23657fc..d818d7f9f8 100644 --- a/vendor/github.com/google/go-github/v65/github/orgs_members.go +++ b/vendor/github.com/google/go-github/v66/github/orgs_members.go @@ -151,6 +151,20 @@ func (s *OrganizationsService) RemoveMember(ctx context.Context, org, user strin return s.client.Do(ctx, req, nil) } +// CancelInvite cancels an organization invitation. +// +// GitHub API docs: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation +// +//meta:operation DELETE /orgs/{org}/invitations/{invitation_id} +func (s *OrganizationsService) CancelInvite(ctx context.Context, org string, invitationID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/invitations/%v", org, invitationID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + // PublicizeMembership publicizes a user's membership in an organization. (A // user cannot publicize the membership for another user.) // @@ -395,7 +409,7 @@ func (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, return orgInvitationTeams, resp, nil } -// ListFailedOrgInvitations returns a list of failed inviatations. +// ListFailedOrgInvitations returns a list of failed invitations. // // GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations // diff --git a/vendor/github.com/google/go-github/v65/github/orgs_custom_roles.go b/vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go similarity index 62% rename from vendor/github.com/google/go-github/v65/github/orgs_custom_roles.go rename to vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go index ca0c6d7bcb..0954b92d41 100644 --- a/vendor/github.com/google/go-github/v65/github/orgs_custom_roles.go +++ b/vendor/github.com/google/go-github/v66/github/orgs_organization_roles.go @@ -29,39 +29,12 @@ type CustomOrgRoles struct { BaseRole *string `json:"base_role,omitempty"` } -// OrganizationCustomRepoRoles represents custom repository roles available in specified organization. -type OrganizationCustomRepoRoles struct { - TotalCount *int `json:"total_count,omitempty"` - CustomRepoRoles []*CustomRepoRoles `json:"custom_roles,omitempty"` -} - -// CustomRepoRoles represents custom repository roles for an organization. -// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization -// for more information. -type CustomRepoRoles struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions,omitempty"` - Org *Organization `json:"organization,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - // CreateOrUpdateOrgRoleOptions represents options required to create or update a custom organization role. type CreateOrUpdateOrgRoleOptions struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` Permissions []string `json:"permissions"` -} - -// CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role. -type CreateOrUpdateCustomRepoRoleOptions struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions"` } // ListRoles lists the custom roles available in this organization. @@ -87,10 +60,33 @@ func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*Orga return customRepoRoles, resp, nil } +// GetOrgRole gets an organization role in this organization. +// In order to get organization roles in an organization, the authenticated user must be an organization owner, or have access via an organization role. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role +// +//meta:operation GET /orgs/{org}/organization-roles/{role_id} +func (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resultingRole := new(CustomOrgRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return nil, resp, err + } + + return resultingRole, resp, err +} + // CreateCustomOrgRole creates a custom role in this organization. // In order to create custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#create-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#create-a-custom-organization-role // //meta:operation POST /orgs/{org}/organization-roles func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { @@ -113,7 +109,7 @@ func (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org stri // UpdateCustomOrgRole updates a custom role in this organization. // In order to update custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#update-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#update-a-custom-organization-role // //meta:operation PATCH /orgs/{org}/organization-roles/{role_id} func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateOrgRoleOptions) (*CustomOrgRoles, *Response, error) { @@ -136,7 +132,7 @@ func (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org stri // DeleteCustomOrgRole deletes an existing custom role in this organization. // In order to delete custom roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#delete-a-custom-organization-role +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#delete-a-custom-organization-role // //meta:operation DELETE /orgs/{org}/organization-roles/{role_id} func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org string, roleID int64) (*Response, error) { @@ -156,91 +152,87 @@ func (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org stri return resp, nil } -// ListCustomRepoRoles lists the custom repository roles available in this organization. -// In order to see custom repository roles in an organization, the authenticated user must be an organization owner. +// AssignOrgRoleToTeam assigns an existing organization role to a team in this organization. +// In order to assign organization roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team // -//meta:operation GET /orgs/{org}/custom-repository-roles -func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) +//meta:operation PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} +func (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID) - req, err := s.client.NewRequest("GET", u, nil) + req, err := s.client.NewRequest("PUT", u, nil) if err != nil { - return nil, nil, err + return nil, err } - customRepoRoles := new(OrganizationCustomRepoRoles) - resp, err := s.client.Do(ctx, req, customRepoRoles) + resp, err := s.client.Do(ctx, req, nil) if err != nil { - return nil, resp, err + return resp, err } - return customRepoRoles, resp, nil + return resp, nil } -// CreateCustomRepoRole creates a custom repository role in this organization. -// In order to create custom repository roles in an organization, the authenticated user must be an organization owner. +// RemoveOrgRoleFromTeam removes an existing organization role assignment from a team in this organization. +// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team // -//meta:operation POST /orgs/{org}/custom-repository-roles -func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles", org) +//meta:operation DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id} +func (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/teams/%v/%v", org, teamSlug, roleID) - req, err := s.client.NewRequest("POST", u, opts) + req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { - return nil, nil, err + return nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + resp, err := s.client.Do(ctx, req, nil) if err != nil { - return nil, resp, err + return resp, err } - return resultingRole, resp, err + return resp, nil } -// UpdateCustomRepoRole updates a custom repository role in this organization. -// In order to update custom repository roles in an organization, the authenticated user must be an organization owner. +// AssignOrgRoleToUser assigns an existing organization role to a user in this organization. +// In order to assign organization roles in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user // -//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id} -func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) +//meta:operation PUT /orgs/{org}/organization-roles/users/{username}/{role_id} +func (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID) - req, err := s.client.NewRequest("PATCH", u, opts) + req, err := s.client.NewRequest("PUT", u, nil) if err != nil { - return nil, nil, err + return nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + resp, err := s.client.Do(ctx, req, nil) if err != nil { - return nil, resp, err + return resp, err } - return resultingRole, resp, err + return resp, nil } -// DeleteCustomRepoRole deletes an existing custom repository role in this organization. -// In order to delete custom repository roles in an organization, the authenticated user must be an organization owner. +// RemoveOrgRoleFromUser removes an existing organization role assignment from a user in this organization. +// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user // -//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id} -func (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/custom-repository-roles/%v", org, roleID) +//meta:operation DELETE /orgs/{org}/organization-roles/users/{username}/{role_id} +func (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, username string, roleID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/users/%v/%v", org, username, roleID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { return nil, err } - resultingRole := new(CustomRepoRoles) - resp, err := s.client.Do(ctx, req, resultingRole) + resp, err := s.client.Do(ctx, req, nil) if err != nil { return resp, err } diff --git a/vendor/github.com/google/go-github/v65/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v66/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v66/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_packages.go b/vendor/github.com/google/go-github/v66/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_packages.go rename to vendor/github.com/google/go-github/v66/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v66/github/orgs_personal_access_tokens.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_personal_access_tokens.go rename to vendor/github.com/google/go-github/v66/github/orgs_personal_access_tokens.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_projects.go b/vendor/github.com/google/go-github/v66/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_projects.go rename to vendor/github.com/google/go-github/v66/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_properties.go b/vendor/github.com/google/go-github/v66/github/orgs_properties.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/orgs_properties.go rename to vendor/github.com/google/go-github/v66/github/orgs_properties.go index f7416d5300..d8db48fc94 100644 --- a/vendor/github.com/google/go-github/v65/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v66/github/orgs_properties.go @@ -8,6 +8,7 @@ package github import ( "context" "encoding/json" + "errors" "fmt" ) @@ -42,7 +43,7 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { PropertyName string `json:"property_name"` - Value interface{} `json:"value,omitempty"` + Value interface{} `json:"value"` } // UnmarshalJSON implements the json.Unmarshaler interface. @@ -69,7 +70,7 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { if str, ok := item.(string); ok { strSlice[i] = str } else { - return fmt.Errorf("non-string value in string array") + return errors.New("non-string value in string array") } } cpv.Value = strSlice diff --git a/vendor/github.com/google/go-github/v65/github/orgs_rules.go b/vendor/github.com/google/go-github/v66/github/orgs_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_rules.go rename to vendor/github.com/google/go-github/v66/github/orgs_rules.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v66/github/orgs_security_managers.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v66/github/orgs_security_managers.go diff --git a/vendor/github.com/google/go-github/v65/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v66/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v66/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v65/github/packages.go b/vendor/github.com/google/go-github/v66/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/packages.go rename to vendor/github.com/google/go-github/v66/github/packages.go diff --git a/vendor/github.com/google/go-github/v65/github/projects.go b/vendor/github.com/google/go-github/v66/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/projects.go rename to vendor/github.com/google/go-github/v66/github/projects.go diff --git a/vendor/github.com/google/go-github/v65/github/pulls.go b/vendor/github.com/google/go-github/v66/github/pulls.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/pulls.go rename to vendor/github.com/google/go-github/v66/github/pulls.go index b668502691..35ceda4467 100644 --- a/vendor/github.com/google/go-github/v65/github/pulls.go +++ b/vendor/github.com/google/go-github/v66/github/pulls.go @@ -8,6 +8,7 @@ package github import ( "bytes" "context" + "errors" "fmt" ) @@ -352,7 +353,7 @@ type pullRequestUpdate struct { //meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number} func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { - return nil, nil, fmt.Errorf("pull must be provided") + return nil, nil, errors.New("pull must be provided") } u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) diff --git a/vendor/github.com/google/go-github/v65/github/pulls_comments.go b/vendor/github.com/google/go-github/v66/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/pulls_comments.go rename to vendor/github.com/google/go-github/v66/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v65/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go similarity index 76% rename from vendor/github.com/google/go-github/v65/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v66/github/pulls_reviewers.go index 3f0c50b746..9dd60ae688 100644 --- a/vendor/github.com/google/go-github/v65/github/pulls_reviewers.go +++ b/vendor/github.com/google/go-github/v66/github/pulls_reviewers.go @@ -23,6 +23,13 @@ type Reviewers struct { Teams []*Team `json:"teams,omitempty"` } +type removeReviewersRequest struct { + NodeID *string `json:"node_id,omitempty"` + // Note the lack of omitempty! See comment in RemoveReviewers. + Reviewers []string `json:"reviewers"` + TeamReviewers []string `json:"team_reviewers,omitempty"` +} + // RequestReviewers creates a review request for the provided reviewers for the specified pull request. // // GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request @@ -76,8 +83,21 @@ func (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo str // //meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers func (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) { + // reviewers.Reviewers may be empty if the caller wants to remove teams, but not users. Unlike AddReviewers, + // "reviewers" is a required param here. Reference: https://github.com/google/go-github/issues/3336 + removeRequest := removeReviewersRequest{ + NodeID: reviewers.NodeID, + Reviewers: reviewers.Reviewers, + TeamReviewers: reviewers.TeamReviewers, + } + + if removeRequest.Reviewers == nil { + // GitHub accepts the empty list, but rejects null. Removing `omitempty` is not enough - we also have to promote nil to []. + removeRequest.Reviewers = []string{} + } + u := fmt.Sprintf("repos/%s/%s/pulls/%d/requested_reviewers", owner, repo, number) - req, err := s.client.NewRequest("DELETE", u, &reviewers) + req, err := s.client.NewRequest("DELETE", u, &removeRequest) if err != nil { return nil, err } diff --git a/vendor/github.com/google/go-github/v65/github/pulls_reviews.go b/vendor/github.com/google/go-github/v66/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v66/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v65/github/pulls_threads.go b/vendor/github.com/google/go-github/v66/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/pulls_threads.go rename to vendor/github.com/google/go-github/v66/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v65/github/rate_limit.go b/vendor/github.com/google/go-github/v66/github/rate_limit.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/rate_limit.go rename to vendor/github.com/google/go-github/v66/github/rate_limit.go diff --git a/vendor/github.com/google/go-github/v65/github/reactions.go b/vendor/github.com/google/go-github/v66/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/reactions.go rename to vendor/github.com/google/go-github/v66/github/reactions.go diff --git a/vendor/github.com/google/go-github/v65/github/repos.go b/vendor/github.com/google/go-github/v66/github/repos.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/repos.go rename to vendor/github.com/google/go-github/v66/github/repos.go index 59ef2329f0..9faed401f8 100644 --- a/vendor/github.com/google/go-github/v65/github/repos.go +++ b/vendor/github.com/google/go-github/v66/github/repos.go @@ -738,7 +738,7 @@ func (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (* return s.client.Do(ctx, req, nil) } -// Contributor represents a repository contributor +// Contributor represents a repository contributor. type Contributor struct { Login *string `json:"login,omitempty"` ID *int64 `json:"id,omitempty"` @@ -998,7 +998,7 @@ func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo s return tags, resp, nil } -// Branch represents a repository branch +// Branch represents a repository branch. type Branch struct { Name *string `json:"name,omitempty"` Commit *RepositoryCommit `json:"commit,omitempty"` @@ -1363,7 +1363,7 @@ type BypassPullRequestAllowancesRequest struct { // DismissalRestrictions specifies which users and teams can dismiss pull request reviews. type DismissalRestrictions struct { - // The list of users who can dimiss pull request reviews. + // The list of users who can dismiss pull request reviews. Users []*User `json:"users"` // The list of teams which can dismiss pull request reviews. Teams []*Team `json:"teams"` @@ -1372,7 +1372,7 @@ type DismissalRestrictions struct { } // DismissalRestrictionsRequest represents the request to create/edit the -// restriction to allows only specific users, teams or apps to dimiss pull request reviews. It is +// restriction to allows only specific users, teams or apps to dismiss pull request reviews. It is // separate from DismissalRestrictions above because the request structure is // different from the response structure. // Note: Both Users and Teams must be nil, or both must be non-nil. diff --git a/vendor/github.com/google/go-github/v65/github/repos_actions_access.go b/vendor/github.com/google/go-github/v66/github/repos_actions_access.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v66/github/repos_actions_access.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v66/github/repos_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v66/github/repos_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v66/github/repos_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v66/github/repos_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v66/github/repos_attestations.go b/vendor/github.com/google/go-github/v66/github/repos_attestations.go new file mode 100644 index 0000000000..2e5425502c --- /dev/null +++ b/vendor/github.com/google/go-github/v66/github/repos_attestations.go @@ -0,0 +1,39 @@ +// Copyright 2024 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" +) + +// ListAttestations returns a collection of artifact attestations +// with a given subject digest that are associated with a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-attestations +// +//meta:operation GET /repos/{owner}/{repo}/attestations/{subject_digest} +func (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { + var u = fmt.Sprintf("repos/%v/%v/attestations/%v", owner, repo, subjectDigest) + + 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 attestations *AttestationsResponse + resp, err := s.client.Do(ctx, req, &attestations) + if err != nil { + return nil, resp, err + } + + return attestations, resp, nil +} diff --git a/vendor/github.com/google/go-github/v65/github/repos_autolinks.go b/vendor/github.com/google/go-github/v66/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v66/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_codeowners.go b/vendor/github.com/google/go-github/v66/github/repos_codeowners.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v66/github/repos_codeowners.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_collaborators.go b/vendor/github.com/google/go-github/v66/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v66/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_comments.go b/vendor/github.com/google/go-github/v66/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_comments.go rename to vendor/github.com/google/go-github/v66/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_commits.go b/vendor/github.com/google/go-github/v66/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_commits.go rename to vendor/github.com/google/go-github/v66/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_community_health.go b/vendor/github.com/google/go-github/v66/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_community_health.go rename to vendor/github.com/google/go-github/v66/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_contents.go b/vendor/github.com/google/go-github/v66/github/repos_contents.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/repos_contents.go rename to vendor/github.com/google/go-github/v66/github/repos_contents.go index 97539aeeb5..3a0c266b5e 100644 --- a/vendor/github.com/google/go-github/v65/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v66/github/repos_contents.go @@ -62,7 +62,7 @@ type RepositoryContentFileOptions struct { } // RepositoryContentGetOptions represents an optional ref parameter, which can be a SHA, -// branch, or tag +// branch, or tag. type RepositoryContentGetOptions struct { Ref string `url:"ref,omitempty"` } diff --git a/vendor/github.com/google/go-github/v65/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v66/github/repos_deployment_branch_policies.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v66/github/repos_deployment_branch_policies.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_deployment_protection_rules.go b/vendor/github.com/google/go-github/v66/github/repos_deployment_protection_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_deployment_protection_rules.go rename to vendor/github.com/google/go-github/v66/github/repos_deployment_protection_rules.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_deployments.go b/vendor/github.com/google/go-github/v66/github/repos_deployments.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/repos_deployments.go rename to vendor/github.com/google/go-github/v66/github/repos_deployments.go index d8c0b63218..6277ac2151 100644 --- a/vendor/github.com/google/go-github/v65/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v66/github/repos_deployments.go @@ -12,7 +12,7 @@ import ( "strings" ) -// Deployment represents a deployment in a repo +// Deployment represents a deployment in a repo. type Deployment struct { URL *string `json:"url,omitempty"` ID *int64 `json:"id,omitempty"` @@ -30,7 +30,7 @@ type Deployment struct { NodeID *string `json:"node_id,omitempty"` } -// DeploymentRequest represents a deployment request +// DeploymentRequest represents a deployment request. type DeploymentRequest struct { Ref *string `json:"ref,omitempty"` Task *string `json:"task,omitempty"` @@ -171,7 +171,7 @@ type DeploymentStatus struct { URL *string `json:"url,omitempty"` } -// DeploymentStatusRequest represents a deployment request +// DeploymentStatusRequest represents a deployment request. type DeploymentStatusRequest struct { State *string `json:"state,omitempty"` LogURL *string `json:"log_url,omitempty"` diff --git a/vendor/github.com/google/go-github/v65/github/repos_environments.go b/vendor/github.com/google/go-github/v66/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_environments.go rename to vendor/github.com/google/go-github/v66/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_forks.go b/vendor/github.com/google/go-github/v66/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_forks.go rename to vendor/github.com/google/go-github/v66/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_hooks.go b/vendor/github.com/google/go-github/v66/github/repos_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_hooks.go rename to vendor/github.com/google/go-github/v66/github/repos_hooks.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v66/github/repos_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_hooks_configuration.go rename to vendor/github.com/google/go-github/v66/github/repos_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v66/github/repos_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v66/github/repos_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_invitations.go b/vendor/github.com/google/go-github/v66/github/repos_invitations.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/repos_invitations.go rename to vendor/github.com/google/go-github/v66/github/repos_invitations.go index 4922e0b298..98fe01d1c9 100644 --- a/vendor/github.com/google/go-github/v65/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/v66/github/repos_invitations.go @@ -23,6 +23,7 @@ type RepositoryInvitation struct { CreatedAt *Timestamp `json:"created_at,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` + Expired *bool `json:"expired,omitempty"` } // ListInvitations lists all currently-open repository invitations. diff --git a/vendor/github.com/google/go-github/v65/github/repos_keys.go b/vendor/github.com/google/go-github/v66/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_keys.go rename to vendor/github.com/google/go-github/v66/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_lfs.go b/vendor/github.com/google/go-github/v66/github/repos_lfs.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_lfs.go rename to vendor/github.com/google/go-github/v66/github/repos_lfs.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_merging.go b/vendor/github.com/google/go-github/v66/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_merging.go rename to vendor/github.com/google/go-github/v66/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_pages.go b/vendor/github.com/google/go-github/v66/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_pages.go rename to vendor/github.com/google/go-github/v66/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go similarity index 93% rename from vendor/github.com/google/go-github/v65/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go index 7d85c87362..8bac8bff7e 100644 --- a/vendor/github.com/google/go-github/v65/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v66/github/repos_prereceive_hooks.go @@ -24,7 +24,7 @@ func (p PreReceiveHook) String() string { // ListPreReceiveHooks lists all pre-receive hooks for the specified repository. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) { @@ -53,7 +53,7 @@ func (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, re // GetPreReceiveHook returns a single specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) { @@ -77,7 +77,7 @@ func (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo // UpdatePreReceiveHook updates a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository // //meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) { @@ -101,7 +101,7 @@ func (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, r // DeletePreReceiveHook deletes a specified pre-receive hook. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id} func (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/repos_projects.go b/vendor/github.com/google/go-github/v66/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_projects.go rename to vendor/github.com/google/go-github/v66/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_properties.go b/vendor/github.com/google/go-github/v66/github/repos_properties.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_properties.go rename to vendor/github.com/google/go-github/v66/github/repos_properties.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_releases.go b/vendor/github.com/google/go-github/v66/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_releases.go rename to vendor/github.com/google/go-github/v66/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_rules.go b/vendor/github.com/google/go-github/v66/github/repos_rules.go similarity index 59% rename from vendor/github.com/google/go-github/v65/github/repos_rules.go rename to vendor/github.com/google/go-github/v66/github/repos_rules.go index a90555cc44..0d5052a4b1 100644 --- a/vendor/github.com/google/go-github/v65/github/repos_rules.go +++ b/vendor/github.com/google/go-github/v66/github/repos_rules.go @@ -52,7 +52,7 @@ type RulesetRepositoryIDsConditionParameters struct { type RulesetRepositoryPropertyTargetParameters struct { Name string `json:"name"` Values []string `json:"property_values"` - Source string `json:"source"` + Source *string `json:"source,omitempty"` } // RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. @@ -85,6 +85,21 @@ type RuleFileParameters struct { RestrictedFilePaths *[]string `json:"restricted_file_paths"` } +// RuleMaxFilePathLengthParameters represents the max_file_path_length rule parameters. +type RuleMaxFilePathLengthParameters struct { + MaxFilePathLength int `json:"max_file_path_length"` +} + +// RuleFileExtensionRestrictionParameters represents the file_extension_restriction rule parameters. +type RuleFileExtensionRestrictionParameters struct { + RestrictedFileExtensions []string `json:"restricted_file_extensions"` +} + +// RuleMaxFileSizeParameters represents the max_file_size rule parameters. +type RuleMaxFileSizeParameters struct { + MaxFileSize int64 `json:"max_file_size"` +} + // UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. type UpdateAllowsFetchAndMergeRuleParameters struct { UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` @@ -125,7 +140,7 @@ type MergeQueueRuleParameters struct { // RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. type RequiredStatusChecksRuleParameters struct { - DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create"` + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` } @@ -140,7 +155,20 @@ type RuleRequiredWorkflow struct { // RequiredWorkflowsRuleParameters represents the workflows rule parameters. type RequiredWorkflowsRuleParameters struct { - RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` + DoNotEnforceOnCreate bool `json:"do_not_enforce_on_create,omitempty"` + RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` +} + +// RuleRequiredCodeScanningTool represents a single required code-scanning tool for the RequiredCodeScanningParameters object. +type RuleRequiredCodeScanningTool struct { + AlertsThreshold string `json:"alerts_threshold"` + SecurityAlertsThreshold string `json:"security_alerts_threshold"` + Tool string `json:"tool"` +} + +// RequiredCodeScanningRuleParameters represents the code_scanning rule parameters. +type RequiredCodeScanningRuleParameters struct { + RequiredCodeScanningTools []*RuleRequiredCodeScanningTool `json:"code_scanning_tools"` } // RepositoryRule represents a GitHub Rule. @@ -152,6 +180,226 @@ type RepositoryRule struct { RulesetID int64 `json:"ruleset_id"` } +// RepositoryRulesetEditedChanges represents the changes made to a repository ruleset. +type RepositoryRulesetEditedChanges struct { + Name *RepositoryRulesetEditedSource `json:"name,omitempty"` + Enforcement *RepositoryRulesetEditedSource `json:"enforcement,omitempty"` + Conditions *RepositoryRulesetEditedConditions `json:"conditions,omitempty"` + Rules *RepositoryRulesetEditedRules `json:"rules,omitempty"` +} + +// RepositoryRulesetEditedSource represents a source change for the ruleset. +type RepositoryRulesetEditedSource struct { + From *string `json:"from,omitempty"` +} + +// RepositoryRulesetEditedSources represents multiple source changes for the ruleset. +type RepositoryRulesetEditedSources struct { + From []string `json:"from,omitempty"` +} + +// RepositoryRulesetEditedConditions holds changes to conditions in a ruleset. +type RepositoryRulesetEditedConditions struct { + Added []*RepositoryRulesetRefCondition `json:"added,omitempty"` + Deleted []*RepositoryRulesetRefCondition `json:"deleted,omitempty"` + Updated []*RepositoryRulesetEditedUpdatedConditions `json:"updated,omitempty"` +} + +// RepositoryRulesetEditedRules holds changes to rules in a ruleset. +type RepositoryRulesetEditedRules struct { + Added []*RepositoryRulesetRule `json:"added,omitempty"` + Deleted []*RepositoryRulesetRule `json:"deleted,omitempty"` + Updated []*RepositoryRulesetUpdatedRules `json:"updated,omitempty"` +} + +// RepositoryRulesetRefCondition represents a reference condition for the ruleset. +type RepositoryRulesetRefCondition struct { + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` +} + +// RepositoryRulesetEditedUpdatedConditions holds updates to conditions in a ruleset. +type RepositoryRulesetEditedUpdatedConditions struct { + Condition *RepositoryRulesetRefCondition `json:"condition,omitempty"` + Changes *RepositoryRulesetUpdatedConditionsEdited `json:"changes,omitempty"` +} + +// RepositoryRulesetUpdatedConditionsEdited holds the edited updates to conditions in a ruleset. +type RepositoryRulesetUpdatedConditionsEdited struct { + ConditionType *RepositoryRulesetEditedSource `json:"condition_type,omitempty"` + Target *RepositoryRulesetEditedSource `json:"target,omitempty"` + Include *RepositoryRulesetEditedSources `json:"include,omitempty"` + Exclude *RepositoryRulesetEditedSources `json:"exclude,omitempty"` +} + +// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset. +type RepositoryRulesetUpdatedRules struct { + Rule *RepositoryRulesetRule `json:"rule,omitempty"` + Changes *RepositoryRulesetEditedRuleChanges `json:"changes,omitempty"` +} + +// RepositoryRulesetEditedRuleChanges holds changes made to a rule in a ruleset. +type RepositoryRulesetEditedRuleChanges struct { + Configuration *RepositoryRulesetEditedSources `json:"configuration,omitempty"` + RuleType *RepositoryRulesetEditedSources `json:"rule_type,omitempty"` + Pattern *RepositoryRulesetEditedSources `json:"pattern,omitempty"` +} + +// RepositoryRuleset represents the structure of a ruleset associated with a GitHub repository. +type RepositoryRuleset struct { + ID int64 `json:"id"` + Name string `json:"name"` + // Possible values for target: "branch", "tag", "push" + Target *string `json:"target,omitempty"` + // Possible values for source type: "Repository", "Organization" + SourceType *string `json:"source_type,omitempty"` + Source string `json:"source"` + // Possible values for enforcement: "disabled", "active", "evaluate" + Enforcement string `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors,omitempty"` + // Possible values for current user can bypass: "always", "pull_requests_only", "never" + CurrentUserCanBypass *string `json:"current_user_can_bypass,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Links *RepositoryRulesetLink `json:"_links,omitempty"` + Conditions json.RawMessage `json:"conditions,omitempty"` + Rules []*RepositoryRulesetRule `json:"rules,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +// RepositoryRulesetRule represents individual rules which are present in a repository's ruleset. +type RepositoryRulesetRule struct { + Creation *RepositoryRulesetRuleType `json:"creation,omitempty"` + Update *RepositoryRulesetUpdateRule `json:"update,omitempty"` + Deletion *RepositoryRulesetRuleType `json:"deletion,omitempty"` + RequiredLinearHistory *RepositoryRulesetRuleType `json:"required_linear_history,omitempty"` + MergeQueue *RepositoryRulesetMergeQueueRule `json:"merge_queue,omitempty"` + RequiredDeployments *RepositoryRulesetRequiredDeploymentsRule `json:"required_deployments,omitempty"` + RequiredSignatures *RepositoryRulesetRuleType `json:"required_signatures,omitempty"` + PullRequest *RepositoryRulesetPullRequestRule `json:"pull_request,omitempty"` + RequiredStatusChecks *RepositoryRulesetRequiredStatusChecksRule `json:"required_status_checks,omitempty"` + NonFastForward *RepositoryRulesetRuleType `json:"non_fast_forward,omitempty"` + CommitMessagePattern *RepositoryRulesetPatternRule `json:"commit_message_pattern,omitempty"` + CommitAuthorEmailPattern *RepositoryRulesetPatternRule `json:"commit_author_email_pattern,omitempty"` + CommitterEmailPattern *RepositoryRulesetPatternRule `json:"committer_email_pattern,omitempty"` + BranchNamePattern *RepositoryRulesetPatternRule `json:"branch_name_pattern,omitempty"` + TagNamePattern *RepositoryRulesetPatternRule `json:"tag_name_pattern,omitempty"` + FilePathRestriction *RepositoryRulesetFilePathRestrictionRule `json:"file_path_restriction,omitempty"` + MaxFilePathLength *RepositoryRulesetMaxFilePathLengthRule `json:"max_file_path_length,omitempty"` + FileExtensionRestriction *RepositoryRulesetFileExtensionRestrictionRule `json:"file_extension_restriction,omitempty"` + MaxFileSize *RepositoryRulesetMaxFileSizeRule `json:"max_file_size,omitempty"` + Workflows *RepositoryRulesetWorkflowsRule `json:"workflows,omitempty"` + CodeScanning *RepositoryRulesetCodeScanningRule `json:"code_scanning,omitempty"` +} + +// RepositoryRulesetLink represents Links associated with a repository's rulesets. These links are used to provide more information about the ruleset. +type RepositoryRulesetLink struct { + Self *RulesetLink `json:"self,omitempty"` + HTML *RulesetLink `json:"html,omitempty"` +} + +// RepositoryRulesetRuleType represents the type of a ruleset rule. +type RepositoryRulesetRuleType struct { + Type string `json:"type"` +} + +// RepositoryRulesetUpdateRule defines an update rule for the repository. +type RepositoryRulesetUpdateRule struct { + // Type can be one of: "update". + Type string `json:"type"` + Parameters *UpdateAllowsFetchAndMergeRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetMergeQueueRule defines a merge queue rule for the repository. +type RepositoryRulesetMergeQueueRule struct { + // Type can be one of: "merge_queue". + Type string `json:"type"` + Parameters *MergeQueueRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetRequiredDeploymentsRule defines a rule for required deployments. +type RepositoryRulesetRequiredDeploymentsRule struct { + // Type can be one of: "required_deployments". + Type string `json:"type"` + Parameters *RequiredDeploymentEnvironmentsRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetPullRequestRule defines a rule for pull requests. +type RepositoryRulesetPullRequestRule struct { + // Type can be one of: "pull_request". + + Type string `json:"type"` + Parameters *PullRequestRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetRequiredStatusChecksRule defines a rule for required status checks. +type RepositoryRulesetRequiredStatusChecksRule struct { + // Type can be one of: "required_status_checks". + + Type string `json:"type"` + Parameters *RequiredStatusChecksRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetPatternRule defines a pattern rule for the repository. +type RepositoryRulesetPatternRule struct { + Type string `json:"type"` + Parameters *RulePatternParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetFilePathRestrictionRule defines a file path restriction rule for the repository. +type RepositoryRulesetFilePathRestrictionRule struct { + // Type can be one of: "file_path_restriction". + Type string `json:"type"` + Parameters *RuleFileParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetMaxFilePathLengthRule defines a maximum file path length rule for the repository. +type RepositoryRulesetMaxFilePathLengthRule struct { + // Type can be one of: "max_file_path_length". + + Type string `json:"type"` + Parameters *RuleMaxFilePathLengthParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetFileExtensionRestrictionRule defines a file extension restriction rule for the repository. +type RepositoryRulesetFileExtensionRestrictionRule struct { + // Type can be one of: "file_extension_restriction". + Type string `json:"type"` + Parameters *RuleFileExtensionRestrictionParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetMaxFileSizeRule defines a maximum file size rule for the repository. +type RepositoryRulesetMaxFileSizeRule struct { + // Type can be one of: "max_file_size". + Type string `json:"type"` + Parameters *RuleMaxFileSizeParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetWorkflowsRule defines a workflow rule for the repository. +type RepositoryRulesetWorkflowsRule struct { + // Type can be one of: "workflows". + Type string `json:"type"` + Parameters *RequiredWorkflowsRuleParameters `json:"parameters,omitempty"` +} + +// RepositoryRulesetCodeScanningRule defines a code scanning rule for the repository. +type RepositoryRulesetCodeScanningRule struct { + // Type can be one of: "code_scanning". + Type string `json:"type"` + Parameters *RuleCodeScanningParameters `json:"parameters,omitempty"` +} + +// RuleCodeScanningParameters defines parameters for code scanning rules. +type RuleCodeScanningParameters struct { + CodeScanningTools []*CodeScanningTool `json:"code_scanning_tools,omitempty"` +} + +// CodeScanningTool defines a specific tool used for code scanning. +type CodeScanningTool struct { + AlertsThreshold string `json:"alerts_threshold"` + SecurityAlertsThreshold string `json:"security_alerts_threshold"` + Tool string `json:"tool"` +} + // UnmarshalJSON implements the json.Unmarshaler interface. // This helps us handle the fact that RepositoryRule parameter field can be of numerous types. func (r *RepositoryRule) UnmarshalJSON(data []byte) error { @@ -255,6 +503,42 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { bytes, _ := json.Marshal(params) rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams + case "code_scanning": + params := RequiredCodeScanningRuleParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "max_file_path_length": + params := RuleMaxFilePathLengthParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "file_extension_restriction": + params := RuleFileExtensionRestrictionParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "max_file_size": + params := RuleMaxFileSizeParameters{} + if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { + return err + } + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + r.Parameters = &rawParams default: r.Type = "" @@ -442,6 +726,18 @@ func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *Re } } +// NewRequiredCodeScanningRule creates a rule to require which tools must provide code scanning results before the reference is updated. +func NewRequiredCodeScanningRule(params *RequiredCodeScanningRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "code_scanning", + Parameters: &rawParams, + } +} + // NewFilePathRestrictionRule creates a rule to restrict file paths from being pushed to. func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRule) { bytes, _ := json.Marshal(params) @@ -454,11 +750,47 @@ func NewFilePathRestrictionRule(params *RuleFileParameters) (rule *RepositoryRul } } +// NewMaxFilePathLengthRule creates a rule to restrict file paths longer than the limit from being pushed. +func NewMaxFilePathLengthRule(params *RuleMaxFilePathLengthParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "max_file_path_length", + Parameters: &rawParams, + } +} + +// NewFileExtensionRestrictionRule creates a rule to restrict file extensions from being pushed to a commit. +func NewFileExtensionRestrictionRule(params *RuleFileExtensionRestrictionParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "file_extension_restriction", + Parameters: &rawParams, + } +} + +// NewMaxFileSizeRule creates a rule to restrict file sizes from being pushed to a commit. +func NewMaxFileSizeRule(params *RuleMaxFileSizeParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "max_file_size", + Parameters: &rawParams, + } +} + // Ruleset represents a GitHub ruleset object. type Ruleset struct { ID *int64 `json:"id,omitempty"` Name string `json:"name"` - // Possible values for Target are branch, tag + // Possible values for Target are branch, tag, push Target *string `json:"target,omitempty"` // Possible values for SourceType are: Repository, Organization SourceType *string `json:"source_type,omitempty"` @@ -470,6 +802,8 @@ type Ruleset struct { Links *RulesetLinks `json:"_links,omitempty"` Conditions *RulesetConditions `json:"conditions,omitempty"` Rules []*RepositoryRule `json:"rules,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } // rulesetNoOmitBypassActors represents a GitHub ruleset object. The struct does not omit bypassActors if the field is nil or an empty array is passed. diff --git a/vendor/github.com/google/go-github/v65/github/repos_stats.go b/vendor/github.com/google/go-github/v66/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_stats.go rename to vendor/github.com/google/go-github/v66/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_statuses.go b/vendor/github.com/google/go-github/v66/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_statuses.go rename to vendor/github.com/google/go-github/v66/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v65/github/repos_tags.go b/vendor/github.com/google/go-github/v66/github/repos_tags.go similarity index 62% rename from vendor/github.com/google/go-github/v65/github/repos_tags.go rename to vendor/github.com/google/go-github/v66/github/repos_tags.go index 93164dd1b8..3fb7f583d1 100644 --- a/vendor/github.com/google/go-github/v65/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v66/github/repos_tags.go @@ -22,9 +22,10 @@ type tagProtectionRequest struct { Pattern string `json:"pattern"` } -// ListTagProtection lists tag protection of the specified repository. +// Deprecated: ListTagProtection lists tag protection of the specified repository. +// Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets // -// GitHub API docs: https://docs.github.com/rest/repos/tags#list-tag-protection-states-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) { @@ -44,9 +45,10 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo return tagProtections, resp, nil } -// CreateTagProtection creates the tag protection of the specified repository. +// Deprecated: CreateTagProtection creates the tag protection of the specified repository. +// Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#create-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository // //meta:operation POST /repos/{owner}/{repo}/tags/protection func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) { @@ -66,9 +68,10 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re return tagProtection, resp, nil } -// DeleteTagProtection deletes a tag protection from the specified repository. +// Deprecated: DeleteTagProtection deletes a tag protection from the specified repository. +// Deprecation notice: This operation is deprecated and will be removed after August 30, 2024. Use the "Repository Rulesets" endpoint instead: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset // -// GitHub API docs: https://docs.github.com/rest/repos/tags#delete-a-tag-protection-state-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository // //meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id} func (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v65/github/repos_traffic.go b/vendor/github.com/google/go-github/v66/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/repos_traffic.go rename to vendor/github.com/google/go-github/v66/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v65/github/scim.go b/vendor/github.com/google/go-github/v66/github/scim.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/scim.go rename to vendor/github.com/google/go-github/v66/github/scim.go diff --git a/vendor/github.com/google/go-github/v65/github/search.go b/vendor/github.com/google/go-github/v66/github/search.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/search.go rename to vendor/github.com/google/go-github/v66/github/search.go index 71efe87a03..54bc6d5e1f 100644 --- a/vendor/github.com/google/go-github/v65/github/search.go +++ b/vendor/github.com/google/go-github/v66/github/search.go @@ -209,7 +209,7 @@ type Match struct { Indices []int `json:"indices,omitempty"` } -// TextMatch represents a text match for a SearchResult +// TextMatch represents a text match for a SearchResult. type TextMatch struct { ObjectURL *string `json:"object_url,omitempty"` ObjectType *string `json:"object_type,omitempty"` diff --git a/vendor/github.com/google/go-github/v65/github/secret_scanning.go b/vendor/github.com/google/go-github/v66/github/secret_scanning.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/secret_scanning.go rename to vendor/github.com/google/go-github/v66/github/secret_scanning.go diff --git a/vendor/github.com/google/go-github/v65/github/security_advisories.go b/vendor/github.com/google/go-github/v66/github/security_advisories.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/security_advisories.go rename to vendor/github.com/google/go-github/v66/github/security_advisories.go diff --git a/vendor/github.com/google/go-github/v65/github/strings.go b/vendor/github.com/google/go-github/v66/github/strings.go similarity index 85% rename from vendor/github.com/google/go-github/v65/github/strings.go rename to vendor/github.com/google/go-github/v66/github/strings.go index 147c515e2c..f5e61aa326 100644 --- a/vendor/github.com/google/go-github/v65/github/strings.go +++ b/vendor/github.com/google/go-github/v66/github/strings.go @@ -27,7 +27,7 @@ func Stringify(message interface{}) string { func stringifyValue(w *bytes.Buffer, val reflect.Value) { if val.Kind() == reflect.Ptr && val.IsNil() { - w.Write([]byte("")) + w.WriteString("") return } @@ -37,20 +37,20 @@ func stringifyValue(w *bytes.Buffer, val reflect.Value) { case reflect.String: fmt.Fprintf(w, `"%s"`, v) case reflect.Slice: - w.Write([]byte{'['}) + w.WriteByte('[') for i := 0; i < v.Len(); i++ { if i > 0 { - w.Write([]byte{' '}) + w.WriteByte(' ') } stringifyValue(w, v.Index(i)) } - w.Write([]byte{']'}) + w.WriteByte(']') return case reflect.Struct: if v.Type().Name() != "" { - w.Write([]byte(v.Type().String())) + w.WriteString(v.Type().String()) } // special handling of Timestamp values @@ -59,7 +59,7 @@ func stringifyValue(w *bytes.Buffer, val reflect.Value) { return } - w.Write([]byte{'{'}) + w.WriteByte('{') var sep bool for i := 0; i < v.NumField(); i++ { @@ -75,17 +75,17 @@ func stringifyValue(w *bytes.Buffer, val reflect.Value) { } if sep { - w.Write([]byte(", ")) + w.WriteString(", ") } else { sep = true } - w.Write([]byte(v.Type().Field(i).Name)) - w.Write([]byte{':'}) + w.WriteString(v.Type().Field(i).Name) + w.WriteByte(':') stringifyValue(w, fv) } - w.Write([]byte{'}'}) + w.WriteByte('}') default: if v.CanInterface() { fmt.Fprint(w, v.Interface()) diff --git a/vendor/github.com/google/go-github/v65/github/teams.go b/vendor/github.com/google/go-github/v66/github/teams.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/teams.go rename to vendor/github.com/google/go-github/v66/github/teams.go index b44e9418c0..df248b6540 100644 --- a/vendor/github.com/google/go-github/v65/github/teams.go +++ b/vendor/github.com/google/go-github/v66/github/teams.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "net/http" - "strings" ) // TeamsService provides access to the team-related functions @@ -206,13 +205,14 @@ func (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) // "parent_team_id" field will be null. It is for internal use // only and should not be exported. type newTeamNoParent struct { - Name string `json:"name"` - Description *string `json:"description,omitempty"` - Maintainers []string `json:"maintainers,omitempty"` - RepoNames []string `json:"repo_names,omitempty"` - ParentTeamID *int64 `json:"parent_team_id"` // This will be "null" - Privacy *string `json:"privacy,omitempty"` - LDAPDN *string `json:"ldap_dn,omitempty"` + Name string `json:"name"` + Description *string `json:"description,omitempty"` + Maintainers []string `json:"maintainers,omitempty"` + RepoNames []string `json:"repo_names,omitempty"` + ParentTeamID *int64 `json:"parent_team_id"` // This will be "null" + NotificationSetting *string `json:"notification_setting,omitempty"` + Privacy *string `json:"privacy,omitempty"` + LDAPDN *string `json:"ldap_dn,omitempty"` } // copyNewTeamWithoutParent is used to set the "parent_team_id" @@ -220,12 +220,13 @@ type newTeamNoParent struct { // It is for internal use only and should not be exported. func copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent { return &newTeamNoParent{ - Name: team.Name, - Description: team.Description, - Maintainers: team.Maintainers, - RepoNames: team.RepoNames, - Privacy: team.Privacy, - LDAPDN: team.LDAPDN, + Name: team.Name, + Description: team.Description, + Maintainers: team.Maintainers, + RepoNames: team.RepoNames, + NotificationSetting: team.NotificationSetting, + Privacy: team.Privacy, + LDAPDN: team.LDAPDN, } } @@ -387,8 +388,7 @@ func (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int6 } // TODO: remove custom Accept header when topics API fully launches. - headers := []string{mediaTypeTopicsPreview} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) @@ -417,8 +417,7 @@ func (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string } // TODO: remove custom Accept header when topics API fully launches. - headers := []string{mediaTypeTopicsPreview} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeTopicsPreview) var repos []*Repository resp, err := s.client.Do(ctx, req, &repos) @@ -443,8 +442,7 @@ func (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, return nil, nil, err } - headers := []string{mediaTypeOrgPermissionRepo} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeOrgPermissionRepo) repository := new(Repository) resp, err := s.client.Do(ctx, req, repository) @@ -469,8 +467,7 @@ func (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, r return nil, nil, err } - headers := []string{mediaTypeOrgPermissionRepo} - req.Header.Set("Accept", strings.Join(headers, ", ")) + req.Header.Set("Accept", mediaTypeOrgPermissionRepo) repository := new(Repository) resp, err := s.client.Do(ctx, req, repository) @@ -604,8 +601,7 @@ func (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID i } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -630,8 +626,7 @@ func (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug str } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) var projects []*Project resp, err := s.client.Do(ctx, req, &projects) @@ -656,8 +651,7 @@ func (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) projects := &Project{} resp, err := s.client.Do(ctx, req, &projects) @@ -682,8 +676,7 @@ func (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug s } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) projects := &Project{} resp, err := s.client.Do(ctx, req, &projects) @@ -721,8 +714,7 @@ func (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, pr } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } @@ -742,8 +734,7 @@ func (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug strin } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } @@ -766,8 +757,7 @@ func (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } @@ -790,8 +780,7 @@ func (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug st } // TODO: remove custom Accept header when this API fully launches. - acceptHeaders := []string{mediaTypeProjectsPreview} - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) + req.Header.Set("Accept", mediaTypeProjectsPreview) return s.client.Do(ctx, req, nil) } diff --git a/vendor/github.com/google/go-github/v65/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v66/github/teams_discussion_comments.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v66/github/teams_discussion_comments.go index ad3818c13f..eba6fdf46a 100644 --- a/vendor/github.com/google/go-github/v65/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/v66/github/teams_discussion_comments.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// DiscussionComment represents a GitHub dicussion in a team. +// DiscussionComment represents a GitHub discussion in a team. type DiscussionComment struct { Author *User `json:"author,omitempty"` Body *string `json:"body,omitempty"` @@ -145,8 +145,8 @@ func (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, d // GitHub API docs: https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment // //meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments -func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discsusionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { - u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discsusionNumber) +func (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) { + u := fmt.Sprintf("organizations/%v/team/%v/discussions/%v/comments", orgID, teamID, discussionNumber) req, err := s.client.NewRequest("POST", u, comment) if err != nil { return nil, nil, err diff --git a/vendor/github.com/google/go-github/v65/github/teams_discussions.go b/vendor/github.com/google/go-github/v66/github/teams_discussions.go similarity index 99% rename from vendor/github.com/google/go-github/v65/github/teams_discussions.go rename to vendor/github.com/google/go-github/v66/github/teams_discussions.go index ee78c032a6..b056525f4e 100644 --- a/vendor/github.com/google/go-github/v65/github/teams_discussions.go +++ b/vendor/github.com/google/go-github/v66/github/teams_discussions.go @@ -10,7 +10,7 @@ import ( "fmt" ) -// TeamDiscussion represents a GitHub dicussion in a team. +// TeamDiscussion represents a GitHub discussion in a team. type TeamDiscussion struct { Author *User `json:"author,omitempty"` Body *string `json:"body,omitempty"` diff --git a/vendor/github.com/google/go-github/v65/github/teams_members.go b/vendor/github.com/google/go-github/v66/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/teams_members.go rename to vendor/github.com/google/go-github/v66/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v65/github/timestamp.go b/vendor/github.com/google/go-github/v66/github/timestamp.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/timestamp.go rename to vendor/github.com/google/go-github/v66/github/timestamp.go index 00c1235e9d..dc1045cf74 100644 --- a/vendor/github.com/google/go-github/v65/github/timestamp.go +++ b/vendor/github.com/google/go-github/v66/github/timestamp.go @@ -46,7 +46,7 @@ func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { return } -// Equal reports whether t and u are equal based on time.Equal +// Equal reports whether t and u are equal based on time.Equal. func (t Timestamp) Equal(u Timestamp) bool { return t.Time.Equal(u.Time) } diff --git a/vendor/github.com/google/go-github/v65/github/users.go b/vendor/github.com/google/go-github/v66/github/users.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/users.go rename to vendor/github.com/google/go-github/v66/github/users.go index 51b2b2193b..c1ab555247 100644 --- a/vendor/github.com/google/go-github/v65/github/users.go +++ b/vendor/github.com/google/go-github/v66/github/users.go @@ -107,9 +107,9 @@ func (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, // GetByID fetches a user. // -// Note: GetByID uses the undocumented GitHub API endpoint "GET /user/{user_id}". +// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user-using-their-id // -//meta:operation GET /user/{user_id} +//meta:operation GET /user/{account_id} func (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) { u := fmt.Sprintf("user/%d", id) req, err := s.client.NewRequest("GET", u, nil) diff --git a/vendor/github.com/google/go-github/v65/github/users_administration.go b/vendor/github.com/google/go-github/v66/github/users_administration.go similarity index 91% rename from vendor/github.com/google/go-github/v65/github/users_administration.go rename to vendor/github.com/google/go-github/v66/github/users_administration.go index 2c86af7336..6b74da5fe8 100644 --- a/vendor/github.com/google/go-github/v65/github/users_administration.go +++ b/vendor/github.com/google/go-github/v66/github/users_administration.go @@ -12,7 +12,7 @@ import ( // PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator // //meta:operation PUT /users/{username}/site_admin func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -28,7 +28,7 @@ func (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Resp // DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator // //meta:operation DELETE /users/{username}/site_admin func (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) { @@ -49,7 +49,7 @@ type UserSuspendOptions struct { // Suspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user // //meta:operation PUT /users/{username}/suspended func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) { @@ -65,7 +65,7 @@ func (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspe // Unsuspend a user on a GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.12/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user // //meta:operation DELETE /users/{username}/suspended func (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v66/github/users_attestations.go b/vendor/github.com/google/go-github/v66/github/users_attestations.go new file mode 100644 index 0000000000..18f60298d8 --- /dev/null +++ b/vendor/github.com/google/go-github/v66/github/users_attestations.go @@ -0,0 +1,40 @@ +// Copyright 2024 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" +) + +// ListAttestations returns a collection of artifact attestations +// with a given subject digest that are associated with repositories +// owned by a user. +// +// GitHub API docs: https://docs.github.com/rest/users/attestations#list-attestations +// +//meta:operation GET /users/{username}/attestations/{subject_digest} +func (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) { + var u = fmt.Sprintf("users/%v/attestations/%v", user, subjectDigest) + + 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 attestations *AttestationsResponse + res, err := s.client.Do(ctx, req, &attestations) + if err != nil { + return nil, res, err + } + + return attestations, res, nil +} diff --git a/vendor/github.com/google/go-github/v65/github/users_blocking.go b/vendor/github.com/google/go-github/v66/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/users_blocking.go rename to vendor/github.com/google/go-github/v66/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v65/github/users_emails.go b/vendor/github.com/google/go-github/v66/github/users_emails.go similarity index 94% rename from vendor/github.com/google/go-github/v65/github/users_emails.go rename to vendor/github.com/google/go-github/v66/github/users_emails.go index 8386de250b..3d0e1bfaaf 100644 --- a/vendor/github.com/google/go-github/v65/github/users_emails.go +++ b/vendor/github.com/google/go-github/v66/github/users_emails.go @@ -7,7 +7,7 @@ package github import "context" -// UserEmail represents user's email address +// UserEmail represents user's email address. type UserEmail struct { Email *string `json:"email,omitempty"` Primary *bool `json:"primary,omitempty"` @@ -86,11 +86,11 @@ func (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Resp func (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) { u := "user/email/visibility" - updateVisiblilityReq := &UserEmail{ + updateVisibilityReq := &UserEmail{ Visibility: &visibility, } - req, err := s.client.NewRequest("PATCH", u, updateVisiblilityReq) + req, err := s.client.NewRequest("PATCH", u, updateVisibilityReq) if err != nil { return nil, nil, err } diff --git a/vendor/github.com/google/go-github/v65/github/users_followers.go b/vendor/github.com/google/go-github/v66/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/users_followers.go rename to vendor/github.com/google/go-github/v66/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v65/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v66/github/users_gpg_keys.go similarity index 98% rename from vendor/github.com/google/go-github/v65/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v66/github/users_gpg_keys.go index de7caaf1bd..2f296a1ef6 100644 --- a/vendor/github.com/google/go-github/v65/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/v66/github/users_gpg_keys.go @@ -97,7 +97,7 @@ func (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Respo return key, resp, nil } -// CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth +// CreateGPGKey creates a GPG key. It requires authentication via Basic Auth // or OAuth with at least write:gpg_key scope. // // GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user diff --git a/vendor/github.com/google/go-github/v65/github/users_keys.go b/vendor/github.com/google/go-github/v66/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/users_keys.go rename to vendor/github.com/google/go-github/v66/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v65/github/users_packages.go b/vendor/github.com/google/go-github/v66/github/users_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/users_packages.go rename to vendor/github.com/google/go-github/v66/github/users_packages.go diff --git a/vendor/github.com/google/go-github/v65/github/users_projects.go b/vendor/github.com/google/go-github/v66/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/users_projects.go rename to vendor/github.com/google/go-github/v66/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v65/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v66/github/users_ssh_signing_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v65/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v66/github/users_ssh_signing_keys.go diff --git a/vendor/github.com/google/go-github/v65/github/with_appengine.go b/vendor/github.com/google/go-github/v66/github/with_appengine.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/with_appengine.go rename to vendor/github.com/google/go-github/v66/github/with_appengine.go index 9053ce1059..9bb95b8c89 100644 --- a/vendor/github.com/google/go-github/v65/github/with_appengine.go +++ b/vendor/github.com/google/go-github/v66/github/with_appengine.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build appengine -// +build appengine // This file provides glue for making github work on App Engine. diff --git a/vendor/github.com/google/go-github/v65/github/without_appengine.go b/vendor/github.com/google/go-github/v66/github/without_appengine.go similarity index 95% rename from vendor/github.com/google/go-github/v65/github/without_appengine.go rename to vendor/github.com/google/go-github/v66/github/without_appengine.go index 0024ae4157..bfdb18ecbb 100644 --- a/vendor/github.com/google/go-github/v65/github/without_appengine.go +++ b/vendor/github.com/google/go-github/v66/github/without_appengine.go @@ -4,7 +4,6 @@ // license that can be found in the LICENSE file. //go:build !appengine -// +build !appengine // This file provides glue for making github work without App Engine. diff --git a/vendor/modules.txt b/vendor/modules.txt index 922bac909f..28c2a8e43f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -440,11 +440,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/v64 v64.0.0 +# github.com/google/go-github/v66 v66.0.1-0.20241027130611-9e5757d5a766 ## explicit; go 1.21 -# github.com/google/go-github/v65 v65.0.0 -## explicit; go 1.21 -github.com/google/go-github/v65/github +github.com/google/go-github/v66/github # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query From c644bee14b1e80de8c0788cfab433979a0355fb0 Mon Sep 17 00:00:00 2001 From: ihor-hrytskiv <39990360+ihor-hrytskiv@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:01:51 +0200 Subject: [PATCH 2/3] feat: Support rule type code_scanning (#2436) * feat: support rule type code_scanning for github_organization_ruleset and github_repository_ruleset * feat: docs * feat: docs * chore: remove tag protection endpoint --------- Co-authored-by: Keegan Campbell --- .../resource_github_organization_ruleset.go | 35 +++++++++++++++++++ ...source_github_organization_ruleset_test.go | 8 +++++ github/resource_github_repository_ruleset.go | 35 +++++++++++++++++++ github/respository_rules_utils.go | 32 +++++++++++++++++ .../docs/r/organization_ruleset.html.markdown | 14 ++++++++ .../docs/r/repository_ruleset.html.markdown | 14 ++++++-- 6 files changed, 136 insertions(+), 2 deletions(-) diff --git a/github/resource_github_organization_ruleset.go b/github/resource_github_organization_ruleset.go index 8495dca389..014b28ef65 100644 --- a/github/resource_github_organization_ruleset.go +++ b/github/resource_github_organization_ruleset.go @@ -457,6 +457,41 @@ func resourceGithubOrganizationRuleset() *schema.Resource { }, }, }, + "required_code_scanning": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "required_code_scanning_tool": { + Type: schema.TypeSet, + MinItems: 1, + Required: true, + Description: "Tools that must provide code scanning results for this rule to pass.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "alerts_threshold": { + Type: schema.TypeString, + Required: true, + Description: "The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`.", + }, + "security_alerts_threshold": { + Type: schema.TypeString, + Required: true, + Description: "The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`.", + }, + "tool": { + Type: schema.TypeString, + Required: true, + Description: "The name of a code scanning tool.", + }, + }, + }, + }, + }, + }, + }, }, }, }, diff --git a/github/resource_github_organization_ruleset_test.go b/github/resource_github_organization_ruleset_test.go index 0c6f744540..9aae9f35b9 100644 --- a/github/resource_github_organization_ruleset_test.go +++ b/github/resource_github_organization_ruleset_test.go @@ -69,6 +69,14 @@ func TestGithubOrganizationRulesets(t *testing.T) { } } + required_code_scanning { + required_code_scanning_tool { + alerts_threshold = "errors" + security_alerts_threshold = "high_or_higher" + tool = "CodeQL" + } + } + branch_name_pattern { name = "test" negate = false diff --git a/github/resource_github_repository_ruleset.go b/github/resource_github_repository_ruleset.go index cb5c7053e3..e1bc9fc3ac 100644 --- a/github/resource_github_repository_ruleset.go +++ b/github/resource_github_repository_ruleset.go @@ -409,6 +409,41 @@ func resourceGithubRepositoryRuleset() *schema.Resource { }, }, }, + "required_code_scanning": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "Choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "required_code_scanning_tool": { + Type: schema.TypeSet, + MinItems: 1, + Required: true, + Description: "Tools that must provide code scanning results for this rule to pass.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "alerts_threshold": { + Type: schema.TypeString, + Required: true, + Description: "The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`.", + }, + "security_alerts_threshold": { + Type: schema.TypeString, + Required: true, + Description: "The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`.", + }, + "tool": { + Type: schema.TypeString, + Required: true, + Description: "The name of a code scanning tool", + }, + }, + }, + }, + }, + }, + }, }, }, }, diff --git a/github/respository_rules_utils.go b/github/respository_rules_utils.go index 7956308678..cfb8ceb462 100644 --- a/github/respository_rules_utils.go +++ b/github/respository_rules_utils.go @@ -362,6 +362,38 @@ func expandRules(input []interface{}, org bool) []*github.RepositoryRule { rulesSlice = append(rulesSlice, github.NewRequiredWorkflowsRule(params)) } + // Required code scanning to pass before merging rule + if v, ok := rulesMap["required_code_scanning"].([]interface{}); ok && len(v) != 0 { + requiredCodeScanningMap := v[0].(map[string]interface{}) + requiredCodeScanningTools := make([]*github.RuleRequiredCodeScanningTool, 0) + + if requiredCodeScanningInput, ok := requiredCodeScanningMap["required_code_scanning_tool"]; ok { + + requiredCodeScanningSet := requiredCodeScanningInput.(*schema.Set) + for _, codeScanningMap := range requiredCodeScanningSet.List() { + codeScanningTool := codeScanningMap.(map[string]interface{}) + + // Get all parameters + alertsThreshold := github.String(codeScanningTool["alerts_threshold"].(string)) + securityAlertsThreshold := github.String(codeScanningTool["security_alerts_threshold"].(string)) + tool := github.String(codeScanningTool["tool"].(string)) + + params := &github.RuleRequiredCodeScanningTool{ + AlertsThreshold: *alertsThreshold, + SecurityAlertsThreshold: *securityAlertsThreshold, + Tool: *tool, + } + + requiredCodeScanningTools = append(requiredCodeScanningTools, params) + } + } + + params := &github.RequiredCodeScanningRuleParameters{ + RequiredCodeScanningTools: requiredCodeScanningTools, + } + rulesSlice = append(rulesSlice, github.NewRequiredCodeScanningRule(params)) + } + return rulesSlice } diff --git a/website/docs/r/organization_ruleset.html.markdown b/website/docs/r/organization_ruleset.html.markdown index a02bb0fcc4..737d3953f4 100644 --- a/website/docs/r/organization_ruleset.html.markdown +++ b/website/docs/r/organization_ruleset.html.markdown @@ -91,6 +91,8 @@ The `rules` block supports the following: * `required_workflows` - (Optional) (Block List, Max: 1) Define which Actions workflows must pass before changes can be merged into a branch matching the rule. Multiple workflows can be specified. (see [below for nested schema](#rules.required_workflows)) +* `required_code_scanning` - (Optional) (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see [below for nested schema](#rules.required_code_scanning)) + * `tag_name_pattern` - (Optional) (Block List, Max: 1) Parameters to be used for the tag_name_pattern rule. This rule only applies to repositories within an enterprise, it cannot be applied to repositories owned by individuals or regular organizations. Conflicts with `branch_name_pattern` as it only applies to rulesets with target `tag`. (see [below for nested schema](#rules.tag_name_pattern)) * `update` - (Optional) (Boolean) Only allow users with bypass permission to update matching refs. @@ -171,6 +173,18 @@ The `rules` block supports the following: * `ref` - (Optional) (String) The optional ref from which to fetch the workflow. Defaults to `master`. +#### rules.required_code_scanning #### + +* `required_code_scanning_tool` - (Required) (Block Set, Min: 1) Actions code scanning tools that are required. Multiple can be defined. (see [below for nested schema](#rules.required_workflows.required_code_scanning_tool)) + +#### rules.required_code_scanning.required_code_scanning_tool #### + +* `alerts_threshold` - (Required) (String) The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + +* `security_alerts_threshold` - (Required) (String) The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. + +* `tool` - (Required) (String) The name of a code scanning tool. + #### rules.tag_name_pattern #### * `operator` - (Required) (String) The operator to use for matching. Can be one of: `starts_with`, `ends_with`, `contains`, `regex`. diff --git a/website/docs/r/repository_ruleset.html.markdown b/website/docs/r/repository_ruleset.html.markdown index e61e4132de..b047fbc119 100644 --- a/website/docs/r/repository_ruleset.html.markdown +++ b/website/docs/r/repository_ruleset.html.markdown @@ -101,6 +101,8 @@ The `rules` block supports the following: * `tag_name_pattern` - (Optional) (Block List, Max: 1) Parameters to be used for the tag_name_pattern rule. This rule only applies to repositories within an enterprise, it cannot be applied to repositories owned by individuals or regular organizations. Conflicts with `branch_name_pattern` as it only applied to rulesets with target `tag`. (see [below for nested schema](#rules.tag_name_pattern)) +* `required_code_scanning` - (Optional) (Block List, Max: 1) Define which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. Multiple code scanning tools can be specified. (see [below for nested schema](#rules.required_code_scanning)) + * `update` - (Optional) (Boolean) Only allow users with bypass permission to update matching refs. * `update_allows_fetch_and_merge` - (Optional) (Boolean) Branch can pull changes from its upstream repository. This is only applicable to forked repositories. Requires `update` to be set to `true`. Note: behaviour is affected by a known bug on the GitHub side which may cause issues when using this parameter. @@ -179,8 +181,6 @@ The `rules` block supports the following: * `integration_id` - (Optional) (Number) The optional integration ID that this status check must originate from. - - #### rules.tag_name_pattern #### * `operator` - (Required) (String) The operator to use for matching. Can be one of: `starts_with`, `ends_with`, `contains`, `regex`. @@ -191,7 +191,17 @@ The `rules` block supports the following: * `negate` - (Optional) (Boolean) If true, the rule will fail if the pattern matches. +#### rules.required_code_scanning #### + +* `required_code_scanning_tool` - (Required) (Block Set, Min: 1) Actions code scanning tools that are required. Multiple can be defined. (see [below for nested schema](#rules.required_workflows.required_code_scanning_tool)) + +#### rules.required_code_scanning.required_code_scanning_tool #### + +* `alerts_threshold` - (Required) (String) The severity level at which code scanning results that raise alerts block a reference update. Can be one of: `none`, `errors`, `errors_and_warnings`, `all`. + +* `security_alerts_threshold` - (Required) (String) The severity level at which code scanning results that raise security alerts block a reference update. Can be one of: `none`, `critical`, `high_or_higher`, `medium_or_higher`, `all`. +* `tool` - (Required) (String) The name of a code scanning tool. #### bypass_actors #### From 84c6bd2189177d0f685121b3b35f2bccecc70b9e Mon Sep 17 00:00:00 2001 From: Sumner Warren Date: Wed, 20 Nov 2024 19:33:45 -0500 Subject: [PATCH 3/3] Add support for tag-based environment deployment branch policy (#2165) * Add Type field to DeploymentBranchPolicyRequest struct The Type field is only necessary when creating a deployment branch policy. When updating a deployment branch policy, the Type field is not needed and is therefore set to nil. Resources: - https://docs.github.com/en/rest/deployments/branch-policies?apiVersion=2022-11-28 * Change name of branch_pattern argument to pattern for github_repository_environment_deployment_policy resource * Add type argument to github_repository_environment_deployment_policy resource * Add tag-based test for github_repository_environment_deployment_policy * Revert "Add tag-based test for github_repository_environment_deployment_policy" This reverts commit 88b13690b22c6dd9e2decc258d3e235b03a6d5cc. * Revert "Add type argument to github_repository_environment_deployment_policy resource" This reverts commit a534219a8dd1d94bbf6afef403992d1b74118d63. * Revert "Change name of branch_pattern argument to pattern for github_repository_environment_deployment_policy resource" This reverts commit 029960b78e43d8f5f5a42d7be769e5e72cba2431. * Revert "Add Type field to DeploymentBranchPolicyRequest struct" This reverts commit af308a1dff2cd51fc29d95e886f3eb0c3a886546. * Add tag_pattern attribute to github_repository_environment_deployment_policy resource * Correct typo See https://github.com/integrations/terraform-provider-github/pull/2050#discussion_r1426991279. * Remove type parameter from deployment policy update * Add pattern assertions to existing tests * Fix pattern read to address existing tag policy test * Fix update to read the configured pattern * Force new resource when pattern type changes * Fix tests by ignoring vulnerability_alerts --------- Co-authored-by: Peter McEvoy Co-authored-by: Keegan Campbell Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com> --- ...hub_repository_deployment_branch_policy.go | 2 +- ...epository_environment_deployment_policy.go | 77 +- ...tory_environment_deployment_policy_test.go | 724 +++++++++++++++++- ...nvironment_deployment_policy.html.markdown | 49 +- 4 files changed, 834 insertions(+), 18 deletions(-) diff --git a/github/resource_github_repository_deployment_branch_policy.go b/github/resource_github_repository_deployment_branch_policy.go index 6957d63067..12cd03c9db 100644 --- a/github/resource_github_repository_deployment_branch_policy.go +++ b/github/resource_github_repository_deployment_branch_policy.go @@ -80,7 +80,7 @@ func resourceGithubRepositoryDeploymentBranchPolicyCreate(d *schema.ResourceData environmentName := d.Get("environment_name").(string) name := d.Get("name").(string) - policy, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, owner, repoName, environmentName, &github.DeploymentBranchPolicyRequest{Name: &name}) + policy, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, owner, repoName, environmentName, &github.DeploymentBranchPolicyRequest{Name: &name, Type: github.String("branch")}) if err != nil { return err } diff --git a/github/resource_github_repository_environment_deployment_policy.go b/github/resource_github_repository_environment_deployment_policy.go index c74d8ea9c5..bfe6f619df 100644 --- a/github/resource_github_repository_environment_deployment_policy.go +++ b/github/resource_github_repository_environment_deployment_policy.go @@ -2,6 +2,7 @@ package github import ( "context" + "fmt" "log" "net/http" "net/url" @@ -34,12 +35,21 @@ func resourceGithubRepositoryEnvironmentDeploymentPolicy() *schema.Resource { Description: "The name of the environment.", }, "branch_pattern": { - Type: schema.TypeString, - Required: true, - ForceNew: false, - Description: "The name pattern that branches must match in order to deploy to the environment.", + Type: schema.TypeString, + Optional: true, + ForceNew: false, + ConflictsWith: []string{"tag_pattern"}, + Description: "The name pattern that branches must match in order to deploy to the environment.", + }, + "tag_pattern": { + Type: schema.TypeString, + Optional: true, + ForceNew: false, + ConflictsWith: []string{"branch_pattern"}, + Description: "The name pattern that tags must match in order to deploy to the environment.", }, }, + CustomizeDiff: customDeploymentPolicyDiffFunction, } } @@ -51,11 +61,21 @@ func resourceGithubRepositoryEnvironmentDeploymentPolicyCreate(d *schema.Resourc owner := meta.(*Owner).name repoName := d.Get("repository").(string) envName := d.Get("environment").(string) - branchPattern := d.Get("branch_pattern").(string) escapedEnvName := url.PathEscape(envName) - createData := github.DeploymentBranchPolicyRequest{ - Name: github.String(branchPattern), + var createData github.DeploymentBranchPolicyRequest + if v, ok := d.GetOk("branch_pattern"); ok { + createData = github.DeploymentBranchPolicyRequest{ + Name: github.String(v.(string)), + Type: github.String("branch"), + } + } else if v, ok := d.GetOk("tag_pattern"); ok { + createData = github.DeploymentBranchPolicyRequest{ + Name: github.String(v.(string)), + Type: github.String("tag"), + } + } else { + return fmt.Errorf("exactly one of %q and %q must be specified", "branch_pattern", "tag_pattern") } resultKey, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, owner, repoName, escapedEnvName, &createData) @@ -98,7 +118,11 @@ func resourceGithubRepositoryEnvironmentDeploymentPolicyRead(d *schema.ResourceD return err } - d.Set("branch_pattern", branchPolicy.GetName()) + if branchPolicy.GetType() == "branch" { + d.Set("branch_pattern", branchPolicy.GetName()) + } else { + d.Set("tag_pattern", branchPolicy.GetName()) + } return nil } @@ -110,6 +134,7 @@ func resourceGithubRepositoryEnvironmentDeploymentPolicyUpdate(d *schema.Resourc repoName := d.Get("repository").(string) envName := d.Get("environment").(string) branchPattern := d.Get("branch_pattern").(string) + tagPattern := d.Get("tag_pattern").(string) escapedEnvName := url.PathEscape(envName) _, _, branchPolicyIdString, err := parseThreePartID(d.Id(), "repository", "environment", "branchPolicyId") if err != nil { @@ -121,8 +146,13 @@ func resourceGithubRepositoryEnvironmentDeploymentPolicyUpdate(d *schema.Resourc return err } + pattern := branchPattern + if branchPattern == "" { + pattern = tagPattern + } + updateData := github.DeploymentBranchPolicyRequest{ - Name: github.String(branchPattern), + Name: github.String(pattern), } resultKey, _, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, owner, repoName, escapedEnvName, branchPolicyId, &updateData) @@ -155,3 +185,32 @@ func resourceGithubRepositoryEnvironmentDeploymentPolicyDelete(d *schema.Resourc return nil } + +func customDeploymentPolicyDiffFunction(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { + oldBranchPattern, newBranchPattern := diff.GetChange("branch_pattern") + + if oldBranchPattern != "" && newBranchPattern == "" { + if err := diff.ForceNew("branch_pattern"); err != nil { + return err + } + } + if oldBranchPattern == "" && newBranchPattern != "" { + if err := diff.ForceNew("branch_pattern"); err != nil { + return err + } + } + + oldTagPattern, newTagPattern := diff.GetChange("tag_pattern") + if oldTagPattern != "" && newTagPattern == "" { + if err := diff.ForceNew("tag_pattern"); err != nil { + return err + } + } + if oldTagPattern == "" && newTagPattern != "" { + if err := diff.ForceNew("tag_pattern"); err != nil { + return err + } + } + + return nil +} diff --git a/github/resource_github_repository_environment_deployment_policy_test.go b/github/resource_github_repository_environment_deployment_policy_test.go index f1de1880f3..61d8554703 100644 --- a/github/resource_github_repository_environment_deployment_policy_test.go +++ b/github/resource_github_repository_environment_deployment_policy_test.go @@ -6,13 +6,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) -func TestAccGithubRepositoryEnvironmentDeploymentPolicy(t *testing.T) { +func TestAccGithubRepositoryEnvironmentDeploymentPolicyBranch(t *testing.T) { randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) - t.Run("creates a repository environment with deployment policy", func(t *testing.T) { + t.Run("creates a repository environment with branch-based deployment policy", func(t *testing.T) { config := fmt.Sprintf(` @@ -22,6 +23,7 @@ func TestAccGithubRepositoryEnvironmentDeploymentPolicy(t *testing.T) { resource "github_repository" "test" { name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true } resource "github_repository_environment" "test" { @@ -58,6 +60,237 @@ func TestAccGithubRepositoryEnvironmentDeploymentPolicy(t *testing.T) { "github_repository_environment_deployment_policy.test", "branch_pattern", "releases/*", ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + ), + ) + + testCase := func(t *testing.T, mode string) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { skipUnlessMode(t, mode) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: config, + Check: check, + }, + }, + }) + } + + t.Run("with an anonymous account", func(t *testing.T) { + t.Skip("anonymous account not supported for this operation") + }) + + t.Run("with an individual account", func(t *testing.T) { + testCase(t, individual) + }) + + t.Run("with an organization account", func(t *testing.T) { + testCase(t, organization) + }) + + }) +} + +func TestAccGithubRepositoryEnvironmentDeploymentPolicyBranchUpdate(t *testing.T) { + + randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) + + t.Run("updates the pattern for a branch-based deployment policy", func(t *testing.T) { + var deploymentPolicyId string + + config1 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + branch_pattern = "main" + } + + `, randomID) + + check1 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + "main", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + ), + testDeploymentPolicyId("github_repository_environment_deployment_policy.test", &deploymentPolicyId), + ) + + config2 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + branch_pattern = "release/*" + } + + `, randomID) + + check2 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + "release/*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + ), + testSameDeploymentPolicyId( + "github_repository_environment_deployment_policy.test", + &deploymentPolicyId, + ), + ) + + testCase := func(t *testing.T, mode string) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { skipUnlessMode(t, mode) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: config1, + Check: check1, + }, + { + Config: config2, + Check: check2, + }, + }, + }) + } + + t.Run("with an anonymous account", func(t *testing.T) { + t.Skip("anonymous account not supported for this operation") + }) + + t.Run("with an individual account", func(t *testing.T) { + testCase(t, individual) + }) + + t.Run("with an organization account", func(t *testing.T) { + testCase(t, organization) + }) + + }) +} + +func TestAccGithubRepositoryEnvironmentDeploymentPolicyTag(t *testing.T) { + + randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) + + t.Run("creates a repository environment with tag-based deployment policy", func(t *testing.T) { + + config := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + tag_pattern = "v*" + } + + `, randomID) + + check := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + "v*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + ), ) testCase := func(t *testing.T, mode string) { @@ -87,3 +320,490 @@ func TestAccGithubRepositoryEnvironmentDeploymentPolicy(t *testing.T) { }) } + +func TestAccGithubRepositoryEnvironmentDeploymentPolicyTagUpdate(t *testing.T) { + + randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) + + t.Run("updates the pattern for a tag-based deployment policy", func(t *testing.T) { + var deploymentPolicyId string + + config1 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + tag_pattern = "v*" + } + + `, randomID) + + check1 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + "v*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + ), + testDeploymentPolicyId("github_repository_environment_deployment_policy.test", &deploymentPolicyId), + ) + + config2 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + tag_pattern = "version*" + } + + `, randomID) + + check2 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + "version*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + ), + testSameDeploymentPolicyId( + "github_repository_environment_deployment_policy.test", + &deploymentPolicyId, + ), + ) + + testCase := func(t *testing.T, mode string) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { skipUnlessMode(t, mode) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: config1, + Check: check1, + }, + { + Config: config2, + Check: check2, + }, + }, + }) + } + + t.Run("with an anonymous account", func(t *testing.T) { + t.Skip("anonymous account not supported for this operation") + }) + + t.Run("with an individual account", func(t *testing.T) { + testCase(t, individual) + }) + + t.Run("with an organization account", func(t *testing.T) { + testCase(t, organization) + }) + + }) +} + +func TestAccGithubRepositoryEnvironmentDeploymentPolicyBranchToTagUpdate(t *testing.T) { + + randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) + + t.Run("recreates deployment policy when pattern type changes from branch to tag", func(t *testing.T) { + var deploymentPolicyId string + + config1 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + branch_pattern = "release/*" + } + + `, randomID) + + check1 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + "release/*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + ), + testDeploymentPolicyId("github_repository_environment_deployment_policy.test", &deploymentPolicyId), + ) + + config2 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + tag_pattern = "v*" + } + + `, randomID) + + check2 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + "v*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + ), + testNewDeploymentPolicyId( + "github_repository_environment_deployment_policy.test", + &deploymentPolicyId, + ), + ) + + testCase := func(t *testing.T, mode string) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { skipUnlessMode(t, mode) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: config1, + Check: check1, + }, + { + Config: config2, + Check: check2, + }, + }, + }) + } + + t.Run("with an anonymous account", func(t *testing.T) { + t.Skip("anonymous account not supported for this operation") + }) + + t.Run("with an individual account", func(t *testing.T) { + testCase(t, individual) + }) + + t.Run("with an organization account", func(t *testing.T) { + testCase(t, organization) + }) + + }) +} + +func TestAccGithubRepositoryEnvironmentDeploymentPolicyTagToBranchUpdate(t *testing.T) { + + randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) + + t.Run("recreates deployment policy when pattern type changes from tag to branch", func(t *testing.T) { + var deploymentPolicyId string + + config1 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + tag_pattern = "v*" + } + + `, randomID) + + check1 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + "v*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + ), + testDeploymentPolicyId("github_repository_environment_deployment_policy.test", &deploymentPolicyId), + ) + + config2 := fmt.Sprintf(` + + data "github_user" "current" { + username = "" + } + + resource "github_repository" "test" { + name = "tf-acc-test-%s" + ignore_vulnerability_alerts_during_read = true + } + + resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } + } + + resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + branch_pattern = "release/*" + } + + `, randomID) + + check2 := resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "repository", + fmt.Sprintf("tf-acc-test-%s", randomID), + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "environment", + "environment/test", + ), + resource.TestCheckResourceAttr( + "github_repository_environment_deployment_policy.test", "branch_pattern", + "release/*", + ), + resource.TestCheckNoResourceAttr( + "github_repository_environment_deployment_policy.test", "tag_pattern", + ), + testNewDeploymentPolicyId( + "github_repository_environment_deployment_policy.test", + &deploymentPolicyId, + ), + ) + + testCase := func(t *testing.T, mode string) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { skipUnlessMode(t, mode) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: config1, + Check: check1, + }, + { + Config: config2, + Check: check2, + }, + }, + }) + } + + t.Run("with an anonymous account", func(t *testing.T) { + t.Skip("anonymous account not supported for this operation") + }) + + t.Run("with an individual account", func(t *testing.T) { + testCase(t, individual) + }) + + t.Run("with an organization account", func(t *testing.T) { + testCase(t, organization) + }) + + }) +} + +func testDeploymentPolicyId(resourceName string, id *string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Resource ID is not set") + } + + *id = rs.Primary.ID + + return nil + } +} + +func testSameDeploymentPolicyId(resourceName string, id *string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Resource ID is not set") + } + + if rs.Primary.ID != *id { + return fmt.Errorf("New resource does not match old resource id: %s, %s", rs.Primary.ID, *id) + } + + return nil + } +} + +func testNewDeploymentPolicyId(resourceName string, id *string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Resource ID is not set") + } + + if rs.Primary.ID == *id { + return fmt.Errorf("New resource matches old resource id: %s", rs.Primary.ID) + } + + return nil + } +} diff --git a/website/docs/r/repository_environment_deployment_policy.html.markdown b/website/docs/r/repository_environment_deployment_policy.html.markdown index df6739e4cb..cafc093ddc 100644 --- a/website/docs/r/repository_environment_deployment_policy.html.markdown +++ b/website/docs/r/repository_environment_deployment_policy.html.markdown @@ -11,6 +11,8 @@ This resource allows you to create and manage environment deployment branch poli ## Example Usage +Create a branch-based deployment policy: + ```hcl data "github_user" "current" { username = "" @@ -21,9 +23,9 @@ resource "github_repository" "test" { } resource "github_repository_environment" "test" { - repository = github_repository.test.name - environment = "environment/test" - wait_timer = 10000 + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 reviewers { users = [data.github_user.current.id] } @@ -34,12 +36,45 @@ resource "github_repository_environment" "test" { } resource "github_repository_environment_deployment_policy" "test" { - repository = github_repository.test.name - environment = github_repository_environment.test.environment + repository = github_repository.test.name + environment = github_repository_environment.test.environment branch_pattern = "releases/*" } ``` +Create a tag-based deployment policy: + +```hcl + +data "github_user" "current" { + username = "" +} + +resource "github_repository" "test" { + name = "tf-acc-test-%s" +} + +resource "github_repository_environment" "test" { + repository = github_repository.test.name + environment = "environment/test" + wait_timer = 10000 + reviewers { + users = [data.github_user.current.id] + } + deployment_branch_policy { + protected_branches = false + custom_branch_policies = true + } +} + +resource "github_repository_environment_deployment_policy" "test" { + repository = github_repository.test.name + environment = github_repository_environment.test.environment + tag_pattern = "v*" +} +``` + + ## Argument Reference The following arguments are supported: @@ -48,7 +83,9 @@ The following arguments are supported: * `repository` - (Required) The repository of the environment. -* `branch_pattern` - (Required) The name pattern that branches must match in order to deploy to the environment. +* `branch_pattern` - (Optional) The name pattern that branches must match in order to deploy to the environment. If not specified, `tag_pattern` must be specified. + +* `tag_pattern` - (Optional) The name pattern that tags must match in order to deploy to the environment. If not specified, `branch_pattern` must be specified. ## Import