From 4b5389c2e614b0e8e184e08709514ef09d5c0c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Martins?= Date: Thu, 5 Dec 2024 12:26:30 +0100 Subject: [PATCH] update github dependency to v67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Martins --- cmd/teams.go | 2 +- cmd/users.go | 2 +- go.mod | 2 +- go.sum | 4 +- pkg/github/client.go | 2 +- pkg/team/manager.go | 2 +- pkg/team/push.go | 2 +- .../google/go-github/v59/github/copilot.go | 311 --- .../v59/github/orgs_personal_access_tokens.go | 36 - .../go-github/v59/github/repos_rules.go | 511 ---- .../google/go-github/{v59 => v67}/AUTHORS | 59 + .../google/go-github/{v59 => v67}/LICENSE | 0 .../go-github/{v59 => v67}/github/actions.go | 0 .../{v59 => v67}/github/actions_artifacts.go | 12 +- .../{v59 => v67}/github/actions_cache.go | 4 +- .../{v59 => v67}/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 | 26 +- .../{v59 => v67}/github/actions_runners.go | 36 +- .../{v59 => v67}/github/actions_secrets.go | 10 +- .../{v59 => v67}/github/actions_variables.go | 30 +- .../github/actions_workflow_jobs.go | 0 .../github/actions_workflow_runs.go | 65 + .../{v59 => v67}/github/actions_workflows.go | 0 .../go-github/{v59 => v67}/github/activity.go | 0 .../{v59 => v67}/github/activity_events.go | 0 .../github/activity_notifications.go | 17 + .../{v59 => v67}/github/activity_star.go | 0 .../{v59 => v67}/github/activity_watching.go | 0 .../go-github/{v59 => v67}/github/admin.go | 4 +- .../{v59 => v67}/github/admin_orgs.go | 6 +- .../{v59 => v67}/github/admin_stats.go | 2 +- .../{v59 => v67}/github/admin_users.go | 8 +- .../go-github/{v59 => v67}/github/apps.go | 126 +- .../{v59 => v67}/github/apps_hooks.go | 0 .../github/apps_hooks_deliveries.go | 0 .../{v59 => v67}/github/apps_installation.go | 0 .../{v59 => v67}/github/apps_manifest.go | 0 .../{v59 => v67}/github/apps_marketplace.go | 0 .../go-github/v67/github/attestations.go | 27 + .../{v59 => v67}/github/authorizations.go | 6 +- .../go-github/{v59 => v67}/github/billing.go | 7 +- .../go-github/{v59 => v67}/github/checks.go | 9 +- .../github/code_scanning.go} | 0 .../{v59 => v67}/github/codesofconduct.go | 4 +- .../{v59 => v67}/github/codespaces.go | 0 .../{v59 => v67}/github/codespaces_secrets.go | 0 .../google/go-github/v67/github/copilot.go | 570 +++++ .../{v59 => v67}/github/dependabot.go | 0 .../{v59 => v67}/github/dependabot_alerts.go | 0 .../{v59 => v67}/github/dependabot_secrets.go | 0 .../{v59 => v67}/github/dependency_graph.go | 0 .../v67/github/dependency_graph_snapshots.go | 113 + .../go-github/{v59 => v67}/github/doc.go | 4 +- .../go-github/{v59 => v67}/github/emojis.go | 2 +- .../{v59 => v67}/github/enterprise.go | 0 .../enterprise_actions_runner_groups.go | 0 .../github/enterprise_actions_runners.go | 23 +- .../github/enterprise_audit_log.go | 0 .../enterprise_code_security_and_analysis.go | 0 .../go-github/{v59 => v67}/github/event.go | 0 .../{v59 => v67}/github/event_types.go | 212 +- .../go-github/{v59 => v67}/github/gists.go | 0 .../{v59 => v67}/github/gists_comments.go | 0 .../go-github/{v59 => v67}/github/git.go | 0 .../{v59 => v67}/github/git_blobs.go | 0 .../{v59 => v67}/github/git_commits.go | 2 +- .../go-github/{v59 => v67}/github/git_refs.go | 0 .../go-github/{v59 => v67}/github/git_tags.go | 0 .../{v59 => v67}/github/git_trees.go | 0 .../{v59 => v67}/github/github-accessors.go | 2178 ++++++++++++++++- .../go-github/{v59 => v67}/github/github.go | 101 +- .../{v59 => v67}/github/gitignore.go | 0 .../{v59 => v67}/github/interactions.go | 0 .../{v59 => v67}/github/interactions_orgs.go | 0 .../{v59 => v67}/github/interactions_repos.go | 0 .../{v59 => v67}/github/issue_import.go | 0 .../go-github/{v59 => v67}/github/issues.go | 0 .../{v59 => v67}/github/issues_assignees.go | 0 .../{v59 => v67}/github/issues_comments.go | 0 .../{v59 => v67}/github/issues_events.go | 0 .../{v59 => v67}/github/issues_labels.go | 2 +- .../{v59 => v67}/github/issues_milestones.go | 0 .../{v59 => v67}/github/issues_timeline.go | 0 .../go-github/{v59 => v67}/github/licenses.go | 0 .../go-github/{v59 => v67}/github/markdown.go | 0 .../go-github/{v59 => v67}/github/messages.go | 139 +- .../go-github/{v59 => v67}/github/meta.go | 30 +- .../{v59 => v67}/github/migrations.go | 0 .../github/migrations_source_import.go | 2 +- .../{v59 => v67}/github/migrations_user.go | 0 .../go-github/{v59 => v67}/github/orgs.go | 0 .../github/orgs_actions_allowed.go | 0 .../github/orgs_actions_permissions.go | 0 .../go-github/v67/github/orgs_attestations.go | 40 + .../{v59 => v67}/github/orgs_audit_log.go | 10 - .../orgs_codesecurity_configurations.go | 284 +++ .../github/orgs_credential_authorizations.go | 12 +- .../github/orgs_custom_repository_roles.go} | 31 +- .../{v59 => v67}/github/orgs_hooks.go | 0 .../github/orgs_hooks_configuration.go | 0 .../github/orgs_hooks_deliveries.go | 0 .../{v59 => v67}/github/orgs_members.go | 16 +- .../v67/github/orgs_organization_roles.go | 295 +++ .../github/orgs_outside_collaborators.go | 0 .../{v59 => v67}/github/orgs_packages.go | 0 .../v67/github/orgs_personal_access_tokens.go | 167 ++ .../{v59 => v67}/github/orgs_projects.go | 0 .../{v59 => v67}/github/orgs_properties.go | 57 +- .../{v59 => v67}/github/orgs_rules.go | 0 .../github/orgs_security_managers.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v59 => v67}/github/packages.go | 0 .../go-github/{v59 => v67}/github/projects.go | 0 .../go-github/{v59 => v67}/github/pulls.go | 16 +- .../{v59 => v67}/github/pulls_comments.go | 0 .../{v59 => v67}/github/pulls_reviewers.go | 22 +- .../{v59 => v67}/github/pulls_reviews.go | 0 .../{v59 => v67}/github/pulls_threads.go | 0 .../{v59 => v67}/github/rate_limit.go | 24 +- .../{v59 => v67}/github/reactions.go | 0 .../go-github/{v59 => v67}/github/repos.go | 162 +- .../github/repos_actions_access.go | 0 .../github/repos_actions_allowed.go | 0 .../github/repos_actions_permissions.go | 0 .../v67/github/repos_attestations.go | 39 + .../{v59 => v67}/github/repos_autolinks.go | 2 +- .../{v59 => v67}/github/repos_codeowners.go | 0 .../github/repos_collaborators.go | 2 + .../{v59 => v67}/github/repos_comments.go | 0 .../{v59 => v67}/github/repos_commits.go | 0 .../github/repos_community_health.go | 0 .../{v59 => v67}/github/repos_contents.go | 16 +- .../repos_deployment_branch_policies.go | 0 .../repos_deployment_protection_rules.go | 0 .../{v59 => v67}/github/repos_deployments.go | 6 +- .../{v59 => v67}/github/repos_environments.go | 0 .../{v59 => v67}/github/repos_forks.go | 0 .../{v59 => v67}/github/repos_hooks.go | 14 +- .../github/repos_hooks_configuration.go | 15 + .../github/repos_hooks_deliveries.go | 0 .../{v59 => v67}/github/repos_invitations.go | 1 + .../{v59 => v67}/github/repos_keys.go | 0 .../{v59 => v67}/github/repos_lfs.go | 0 .../{v59 => v67}/github/repos_merging.go | 0 .../{v59 => v67}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 8 +- .../{v59 => v67}/github/repos_projects.go | 0 .../{v59 => v67}/github/repos_properties.go | 27 + .../{v59 => v67}/github/repos_releases.go | 0 .../go-github/v67/github/repos_rules.go | 995 ++++++++ .../{v59 => v67}/github/repos_stats.go | 0 .../{v59 => v67}/github/repos_statuses.go | 0 .../{v59 => v67}/github/repos_tags.go | 15 +- .../{v59 => v67}/github/repos_traffic.go | 0 .../go-github/{v59 => v67}/github/scim.go | 14 +- .../go-github/{v59 => v67}/github/search.go | 2 +- .../{v59 => v67}/github/secret_scanning.go | 19 +- .../github/security_advisories.go | 0 .../go-github/{v59 => v67}/github/strings.go | 20 +- .../go-github/{v59 => v67}/github/teams.go | 78 +- .../github/teams_discussion_comments.go | 6 +- .../{v59 => v67}/github/teams_discussions.go | 2 +- .../{v59 => v67}/github/teams_members.go | 0 .../{v59 => v67}/github/timestamp.go | 2 +- .../go-github/{v59 => v67}/github/users.go | 4 +- .../github/users_administration.go | 8 +- .../v67/github/users_attestations.go | 40 + .../{v59 => v67}/github/users_blocking.go | 0 .../{v59 => v67}/github/users_emails.go | 6 +- .../{v59 => v67}/github/users_followers.go | 0 .../{v59 => v67}/github/users_gpg_keys.go | 2 +- .../{v59 => v67}/github/users_keys.go | 0 .../{v59 => v67}/github/users_packages.go | 0 .../{v59 => v67}/github/users_projects.go | 0 .../github/users_ssh_signing_keys.go | 0 .../{v59 => v67}/github/with_appengine.go | 1 - .../{v59 => v67}/github/without_appengine.go | 1 - vendor/modules.txt | 6 +- 181 files changed, 5754 insertions(+), 1443 deletions(-) delete mode 100644 vendor/github.com/google/go-github/v59/github/copilot.go delete mode 100644 vendor/github.com/google/go-github/v59/github/orgs_personal_access_tokens.go delete mode 100644 vendor/github.com/google/go-github/v59/github/repos_rules.go rename vendor/github.com/google/go-github/{v59 => v67}/AUTHORS (88%) rename vendor/github.com/google/go-github/{v59 => v67}/LICENSE (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_artifacts.go (93%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_cache.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_oidc.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_permissions_enterprise.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_permissions_orgs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_required_workflows.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_runner_groups.go (84%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_runners.go (91%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_secrets.go (96%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_variables.go (89%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_workflow_jobs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_workflow_runs.go (84%) rename vendor/github.com/google/go-github/{v59 => v67}/github/actions_workflows.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/activity_notifications.go (92%) rename vendor/github.com/google/go-github/{v59 => v67}/github/activity_star.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/admin.go (97%) rename vendor/github.com/google/go-github/{v59 => v67}/github/admin_orgs.go (93%) rename vendor/github.com/google/go-github/{v59 => v67}/github/admin_stats.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/admin_users.go (94%) rename vendor/github.com/google/go-github/{v59 => v67}/github/apps.go (70%) rename vendor/github.com/google/go-github/{v59 => v67}/github/apps_hooks.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/apps_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/apps_installation.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/apps_manifest.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/apps_marketplace.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/attestations.go rename vendor/github.com/google/go-github/{v59 => v67}/github/authorizations.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/billing.go (93%) rename vendor/github.com/google/go-github/{v59 => v67}/github/checks.go (98%) rename vendor/github.com/google/go-github/{v59/github/code-scanning.go => v67/github/code_scanning.go} (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/codesofconduct.go (95%) rename vendor/github.com/google/go-github/{v59 => v67}/github/codespaces.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/codespaces_secrets.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/copilot.go rename vendor/github.com/google/go-github/{v59 => v67}/github/dependabot.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/dependabot_alerts.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/dependabot_secrets.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/dependency_graph.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/dependency_graph_snapshots.go rename vendor/github.com/google/go-github/{v59 => v67}/github/doc.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/emojis.go (95%) rename vendor/github.com/google/go-github/{v59 => v67}/github/enterprise.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/enterprise_actions_runner_groups.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/enterprise_actions_runners.go (83%) rename vendor/github.com/google/go-github/{v59 => v67}/github/enterprise_audit_log.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/enterprise_code_security_and_analysis.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/event.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/event_types.go (89%) rename vendor/github.com/google/go-github/{v59 => v67}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/git.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/git_blobs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/git_commits.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/git_refs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/git_tags.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/git_trees.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/github-accessors.go (92%) rename vendor/github.com/google/go-github/{v59 => v67}/github/github.go (95%) rename vendor/github.com/google/go-github/{v59 => v67}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issue_import.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues_comments.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues_labels.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues_milestones.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/markdown.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/messages.go (69%) rename vendor/github.com/google/go-github/{v59 => v67}/github/meta.go (77%) rename vendor/github.com/google/go-github/{v59 => v67}/github/migrations.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/migrations_source_import.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/migrations_user.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_actions_permissions.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/orgs_attestations.go rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_audit_log.go (93%) create mode 100644 vendor/github.com/google/go-github/v67/github/orgs_codesecurity_configurations.go rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_credential_authorizations.go (83%) rename vendor/github.com/google/go-github/{v59/github/orgs_custom_roles.go => v67/github/orgs_custom_repository_roles.go} (80%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_hooks.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_hooks_configuration.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_members.go (95%) create mode 100644 vendor/github.com/google/go-github/v67/github/orgs_organization_roles.go rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_outside_collaborators.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_packages.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/orgs_personal_access_tokens.go rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_projects.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_properties.go (80%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_rules.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_security_managers.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/orgs_users_blocking.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/packages.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/projects.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/pulls.go (96%) rename vendor/github.com/google/go-github/{v59 => v67}/github/pulls_comments.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/pulls_reviewers.go (76%) rename vendor/github.com/google/go-github/{v59 => v67}/github/pulls_reviews.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/pulls_threads.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/rate_limit.go (81%) rename vendor/github.com/google/go-github/{v59 => v67}/github/reactions.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos.go (93%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_actions_access.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_actions_permissions.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/repos_attestations.go rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_autolinks.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_codeowners.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_collaborators.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_commits.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_contents.go (96%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_deployment_branch_policies.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_deployment_protection_rules.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_deployments.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_environments.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_hooks.go (95%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_hooks_configuration.go (69%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_invitations.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_keys.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_lfs.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_pages.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_prereceive_hooks.go (93%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_projects.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_properties.go (53%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_releases.go (100%) create mode 100644 vendor/github.com/google/go-github/v67/github/repos_rules.go rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_statuses.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_tags.go (62%) rename vendor/github.com/google/go-github/{v59 => v67}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/scim.go (96%) rename vendor/github.com/google/go-github/{v59 => v67}/github/search.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/secret_scanning.go (94%) rename vendor/github.com/google/go-github/{v59 => v67}/github/security_advisories.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/strings.go (85%) rename vendor/github.com/google/go-github/{v59 => v67}/github/teams.go (94%) rename vendor/github.com/google/go-github/{v59 => v67}/github/teams_discussion_comments.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/teams_discussions.go (99%) rename vendor/github.com/google/go-github/{v59 => v67}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/timestamp.go (95%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_administration.go (91%) create mode 100644 vendor/github.com/google/go-github/v67/github/users_attestations.go rename vendor/github.com/google/go-github/{v59 => v67}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_emails.go (94%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_gpg_keys.go (98%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_packages.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_projects.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/users_ssh_signing_keys.go (100%) rename vendor/github.com/google/go-github/{v59 => v67}/github/with_appengine.go (95%) rename vendor/github.com/google/go-github/{v59 => v67}/github/without_appengine.go (95%) diff --git a/cmd/teams.go b/cmd/teams.go index 2366927..1ba047b 100644 --- a/cmd/teams.go +++ b/cmd/teams.go @@ -7,7 +7,7 @@ import ( "context" "fmt" - gh "github.com/google/go-github/v59/github" + gh "github.com/google/go-github/v67/github" "github.com/spf13/cobra" "github.com/cilium/team-manager/pkg/config" diff --git a/cmd/users.go b/cmd/users.go index 208585a..2d6c202 100644 --- a/cmd/users.go +++ b/cmd/users.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - gh "github.com/google/go-github/v59/github" + gh "github.com/google/go-github/v67/github" "github.com/spf13/cobra" "github.com/cilium/team-manager/pkg/config" diff --git a/go.mod b/go.mod index aa031ab..e37138b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/cilium/team-manager go 1.22 require ( - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v67 v67.0.0 github.com/google/renameio v1.0.1 github.com/kr/pretty v0.3.1 github.com/pmezard/go-difflib v1.0.0 diff --git a/go.sum b/go.sum index 08e1b71..3c38832 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA= -github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM= +github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg= +github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY= 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/renameio v1.0.1 h1:Lh/jXZmvZxb0BBeSY5VKEfidcbcbenKjZFzM/q0fSeU= diff --git a/pkg/github/client.go b/pkg/github/client.go index a858bb8..d368e6d 100644 --- a/pkg/github/client.go +++ b/pkg/github/client.go @@ -19,7 +19,7 @@ import ( "fmt" "os" - gh "github.com/google/go-github/v59/github" + gh "github.com/google/go-github/v67/github" "github.com/shurcooL/githubv4" "golang.org/x/oauth2" ) diff --git a/pkg/team/manager.go b/pkg/team/manager.go index 620b2a0..80e91fd 100644 --- a/pkg/team/manager.go +++ b/pkg/team/manager.go @@ -22,7 +22,7 @@ import ( "strings" "time" - gh "github.com/google/go-github/v59/github" + gh "github.com/google/go-github/v67/github" "github.com/schollz/progressbar/v3" "github.com/shurcooL/githubv4" "github.com/shurcooL/graphql" diff --git a/pkg/team/push.go b/pkg/team/push.go index 84aa60d..bbb6c4e 100644 --- a/pkg/team/push.go +++ b/pkg/team/push.go @@ -26,7 +26,7 @@ import ( "github.com/cilium/team-manager/pkg/github" "github.com/cilium/team-manager/pkg/slices" "github.com/cilium/team-manager/pkg/terminal" - gh "github.com/google/go-github/v59/github" + gh "github.com/google/go-github/v67/github" "github.com/shurcooL/githubv4" ) diff --git a/vendor/github.com/google/go-github/v59/github/copilot.go b/vendor/github.com/google/go-github/v59/github/copilot.go deleted file mode 100644 index 51c938c..0000000 --- a/vendor/github.com/google/go-github/v59/github/copilot.go +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "encoding/json" - "fmt" -) - -// CopilotService provides access to the Copilot-related functions -// in the GitHub API. -// -// GitHub API docs: https://docs.github.com/en/rest/copilot/ -type CopilotService service - -// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription. -type CopilotOrganizationDetails struct { - SeatBreakdown *CopilotSeatBreakdown `json:"seat_breakdown"` - PublicCodeSuggestions string `json:"public_code_suggestions"` - CopilotChat string `json:"copilot_chat"` - SeatManagementSetting string `json:"seat_management_setting"` -} - -// CopilotSeatBreakdown represents the breakdown of Copilot for Business seats for the organization. -type CopilotSeatBreakdown struct { - Total int `json:"total"` - AddedThisCycle int `json:"added_this_cycle"` - PendingCancellation int `json:"pending_cancellation"` - PendingInvitation int `json:"pending_invitation"` - ActiveThisCycle int `json:"active_this_cycle"` - InactiveThisCycle int `json:"inactive_this_cycle"` -} - -// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization. -type ListCopilotSeatsResponse struct { - TotalSeats int64 `json:"total_seats"` - Seats []*CopilotSeatDetails `json:"seats"` -} - -// CopilotSeatDetails represents the details of a Copilot for Business seat. -type CopilotSeatDetails struct { - // Assignee can either be a User, Team, or Organization. - Assignee interface{} `json:"assignee"` - AssigningTeam *Team `json:"assigning_team,omitempty"` - PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` - LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` - LastActivityEditor *string `json:"last_activity_editor,omitempty"` - CreatedAt *Timestamp `json:"created_at"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - -// SeatAssignments represents the number of seats assigned. -type SeatAssignments struct { - SeatsCreated int `json:"seats_created"` -} - -// SeatCancellations represents the number of seats cancelled. -type SeatCancellations struct { - SeatsCancelled int `json:"seats_cancelled"` -} - -func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { - // Using an alias to avoid infinite recursion when calling json.Unmarshal - type alias CopilotSeatDetails - var seatDetail alias - - if err := json.Unmarshal(data, &seatDetail); err != nil { - return err - } - - cp.AssigningTeam = seatDetail.AssigningTeam - cp.PendingCancellationDate = seatDetail.PendingCancellationDate - cp.LastActivityAt = seatDetail.LastActivityAt - cp.LastActivityEditor = seatDetail.LastActivityEditor - cp.CreatedAt = seatDetail.CreatedAt - cp.UpdatedAt = seatDetail.UpdatedAt - - switch v := seatDetail.Assignee.(type) { - case map[string]interface{}: - jsonData, err := json.Marshal(seatDetail.Assignee) - if err != nil { - return err - } - - if v["type"] == nil { - return fmt.Errorf("assignee type field is not set") - } - - if t, ok := v["type"].(string); ok && t == "User" { - user := &User{} - if err := json.Unmarshal(jsonData, user); err != nil { - return err - } - cp.Assignee = user - } else if t, ok := v["type"].(string); ok && t == "Team" { - team := &Team{} - if err := json.Unmarshal(jsonData, team); err != nil { - return err - } - cp.Assignee = team - } else if t, ok := v["type"].(string); ok && t == "Organization" { - organization := &Organization{} - if err := json.Unmarshal(jsonData, organization); err != nil { - return err - } - cp.Assignee = organization - } else { - return fmt.Errorf("unsupported assignee type %v", v["type"]) - } - default: - return fmt.Errorf("unsupported assignee type %T", v) - } - - return nil -} - -// GetUser gets the User from the CopilotSeatDetails if the assignee is a user. -func (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*User); return u, ok } - -// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team. -func (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { t, ok := cp.Assignee.(*Team); return t, ok } - -// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization. -func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { - o, ok := cp.Assignee.(*Organization) - return o, ok -} - -// GetCopilotBilling gets Copilot for Business billing information and settings for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-information-and-settings-for-an-organization -// -//meta:operation GET /orgs/{org}/copilot/billing -func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing", org) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var copilotDetails *CopilotOrganizationDetails - resp, err := s.client.Do(ctx, req, &copilotDetails) - if err != nil { - return nil, resp, err - } - - return copilotDetails, resp, nil -} - -// ListCopilotSeats lists Copilot for Business seat assignments for an organization. -// -// To paginate through all seats, populate 'Page' with the number of the last page. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#list-all-copilot-business-seat-assignments-for-an-organization -// -//meta:operation GET /orgs/{org}/copilot/billing/seats -func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/seats", org) - - req, err := s.client.NewRequest("GET", u, opts) - 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-business#add-teams-to-the-copilot-business-subscription-for-an-organization -// -//meta:operation POST /orgs/{org}/copilot/billing/selected_teams -func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - - body := struct { - SelectedTeams []string `json:"selected_teams"` - }{ - SelectedTeams: teamNames, - } - - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - var seatAssignments *SeatAssignments - resp, err := s.client.Do(ctx, req, &seatAssignments) - if err != nil { - return nil, resp, err - } - - return seatAssignments, resp, nil -} - -// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-teams-from-the-copilot-business-subscription-for-an-organization -// -//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams -func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) - - body := struct { - SelectedTeams []string `json:"selected_teams"` - }{ - SelectedTeams: teamNames, - } - - req, err := s.client.NewRequest("DELETE", u, body) - if err != nil { - return nil, nil, err - } - - var seatCancellations *SeatCancellations - resp, err := s.client.Do(ctx, req, &seatCancellations) - if err != nil { - return nil, resp, err - } - - return seatCancellations, resp, nil -} - -// AddCopilotUsers adds users to the Copilot for Business subscription for an organization -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#add-users-to-the-copilot-business-subscription-for-an-organization -// -//meta:operation POST /orgs/{org}/copilot/billing/selected_users -func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - - body := struct { - SelectedUsernames []string `json:"selected_usernames"` - }{ - SelectedUsernames: users, - } - - req, err := s.client.NewRequest("POST", u, body) - if err != nil { - return nil, nil, err - } - - var seatAssignments *SeatAssignments - resp, err := s.client.Do(ctx, req, &seatAssignments) - if err != nil { - return nil, resp, err - } - - return seatAssignments, resp, nil -} - -// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#remove-users-from-the-copilot-business-subscription-for-an-organization -// -//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users -func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { - u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) - - body := struct { - SelectedUsernames []string `json:"selected_usernames"` - }{ - SelectedUsernames: users, - } - - req, err := s.client.NewRequest("DELETE", u, body) - if err != nil { - return nil, nil, err - } - - var seatCancellations *SeatCancellations - resp, err := s.client.Do(ctx, req, &seatCancellations) - if err != nil { - return nil, resp, err - } - - return seatCancellations, resp, nil -} - -// GetSeatDetails gets Copilot for Business seat assignment details for a user. -// -// GitHub API docs: https://docs.github.com/rest/copilot/copilot-business#get-copilot-business-seat-assignment-details-for-a-user -// -//meta:operation GET /orgs/{org}/members/{username}/copilot -func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { - u := fmt.Sprintf("orgs/%v/members/%v/copilot", org, user) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var seatDetails *CopilotSeatDetails - resp, err := s.client.Do(ctx, req, &seatDetails) - if err != nil { - return nil, resp, err - } - - return seatDetails, resp, nil -} diff --git a/vendor/github.com/google/go-github/v59/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v59/github/orgs_personal_access_tokens.go deleted file mode 100644 index 0d78611..0000000 --- a/vendor/github.com/google/go-github/v59/github/orgs_personal_access_tokens.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2023 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" -) - -// ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method. -type ReviewPersonalAccessTokenRequestOptions struct { - Action string `json:"action"` - Reason *string `json:"reason,omitempty"` -} - -// ReviewPersonalAccessTokenRequest approves or denies a pending request to access organization resources via a fine-grained personal access token. -// Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. -// `action` can be one of `approve` or `deny`. -// -// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token -// -//meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id} -func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { - u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) - - req, err := s.client.NewRequest(http.MethodPost, u, &opts) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v59/github/repos_rules.go b/vendor/github.com/google/go-github/v59/github/repos_rules.go deleted file mode 100644 index 479806c..0000000 --- a/vendor/github.com/google/go-github/v59/github/repos_rules.go +++ /dev/null @@ -1,511 +0,0 @@ -// Copyright 2023 The go-github AUTHORS. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package github - -import ( - "context" - "encoding/json" - "fmt" -) - -// BypassActor represents the bypass actors from a ruleset. -type BypassActor struct { - ActorID *int64 `json:"actor_id,omitempty"` - // Possible values for ActorType are: RepositoryRole, Team, Integration, OrganizationAdmin - ActorType *string `json:"actor_type,omitempty"` - // Possible values for BypassMode are: always, pull_request - BypassMode *string `json:"bypass_mode,omitempty"` -} - -// RulesetLink represents a single link object from GitHub ruleset request _links. -type RulesetLink struct { - HRef *string `json:"href,omitempty"` -} - -// RulesetLinks represents the "_links" object in a Ruleset. -type RulesetLinks struct { - Self *RulesetLink `json:"self,omitempty"` -} - -// RulesetRefConditionParameters represents the conditions object for ref_names. -type RulesetRefConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` -} - -// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. -type RulesetRepositoryNamesConditionParameters struct { - Include []string `json:"include"` - Exclude []string `json:"exclude"` - Protected *bool `json:"protected,omitempty"` -} - -// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids. -type RulesetRepositoryIDsConditionParameters struct { - RepositoryIDs []int64 `json:"repository_ids,omitempty"` -} - -// RulesetConditions represents the conditions object in a ruleset. -// Set either RepositoryName or RepositoryID, not both. -type RulesetConditions struct { - RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` - RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` - RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` -} - -// RulePatternParameters represents the rule pattern parameters. -type RulePatternParameters struct { - Name *string `json:"name,omitempty"` - // If Negate is true, the rule will fail if the pattern matches. - Negate *bool `json:"negate,omitempty"` - // Possible values for Operator are: starts_with, ends_with, contains, regex - Operator string `json:"operator"` - Pattern string `json:"pattern"` -} - -// UpdateAllowsFetchAndMergeRuleParameters represents the update rule parameters. -type UpdateAllowsFetchAndMergeRuleParameters struct { - UpdateAllowsFetchAndMerge bool `json:"update_allows_fetch_and_merge"` -} - -// RequiredDeploymentEnvironmentsRuleParameters represents the required_deployments rule parameters. -type RequiredDeploymentEnvironmentsRuleParameters struct { - RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` -} - -// PullRequestRuleParameters represents the pull_request rule parameters. -type PullRequestRuleParameters struct { - DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` - RequireCodeOwnerReview bool `json:"require_code_owner_review"` - RequireLastPushApproval bool `json:"require_last_push_approval"` - RequiredApprovingReviewCount int `json:"required_approving_review_count"` - RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` -} - -// RuleRequiredStatusChecks represents the RequiredStatusChecks for the RequiredStatusChecksRuleParameters object. -type RuleRequiredStatusChecks struct { - Context string `json:"context"` - IntegrationID *int64 `json:"integration_id,omitempty"` -} - -// RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. -type RequiredStatusChecksRuleParameters struct { - RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` - StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` -} - -// RuleRequiredWorkflow represents the Workflow for the RequireWorkflowsRuleParameters object. -type RuleRequiredWorkflow struct { - Path string `json:"path"` - Ref *string `json:"ref,omitempty"` - RepositoryID *int64 `json:"repository_id,omitempty"` - Sha *string `json:"sha,omitempty"` -} - -// RequiredWorkflowsRuleParameters represents the workflows rule parameters. -type RequiredWorkflowsRuleParameters struct { - RequiredWorkflows []*RuleRequiredWorkflow `json:"workflows"` -} - -// RepositoryRule represents a GitHub Rule. -type RepositoryRule struct { - Type string `json:"type"` - Parameters *json.RawMessage `json:"parameters,omitempty"` -} - -// 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 { - type rule RepositoryRule - var RepositoryRule rule - if err := json.Unmarshal(data, &RepositoryRule); err != nil { - return err - } - - r.Type = RepositoryRule.Type - - switch RepositoryRule.Type { - case "creation", "deletion", "required_linear_history", "required_signatures", "non_fast_forward": - r.Parameters = nil - case "update": - if RepositoryRule.Parameters == nil { - r.Parameters = nil - return nil - } - params := UpdateAllowsFetchAndMergeRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - - case "required_deployments": - params := RequiredDeploymentEnvironmentsRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "commit_message_pattern", "commit_author_email_pattern", "committer_email_pattern", "branch_name_pattern", "tag_name_pattern": - params := RulePatternParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "pull_request": - params := PullRequestRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "required_status_checks": - params := RequiredStatusChecksRuleParameters{} - if err := json.Unmarshal(*RepositoryRule.Parameters, ¶ms); err != nil { - return err - } - - bytes, _ := json.Marshal(params) - rawParams := json.RawMessage(bytes) - - r.Parameters = &rawParams - case "workflows": - params := RequiredWorkflowsRuleParameters{} - 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 = "" - r.Parameters = nil - return fmt.Errorf("RepositoryRule.Type %T is not yet implemented, unable to unmarshal", RepositoryRule.Type) - } - - return nil -} - -// NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. -func NewCreationRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "creation", - } -} - -// NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. -func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { - if params != nil { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "update", - Parameters: &rawParams, - } - } - return &RepositoryRule{ - Type: "update", - } -} - -// NewDeletionRule creates a rule to only allow users with bypass permissions to delete matching refs. -func NewDeletionRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "deletion", - } -} - -// NewRequiredLinearHistoryRule creates a rule to prevent merge commits from being pushed to matching branches. -func NewRequiredLinearHistoryRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "required_linear_history", - } -} - -// NewRequiredDeploymentsRule creates a rule to require environments to be successfully deployed before they can be merged into the matching branches. -func NewRequiredDeploymentsRule(params *RequiredDeploymentEnvironmentsRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "required_deployments", - Parameters: &rawParams, - } -} - -// NewRequiredSignaturesRule creates a rule a to require commits pushed to matching branches to have verified signatures. -func NewRequiredSignaturesRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "required_signatures", - } -} - -// NewPullRequestRule creates a rule to require all commits be made to a non-target branch and submitted via a pull request before they can be merged. -func NewPullRequestRule(params *PullRequestRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "pull_request", - Parameters: &rawParams, - } -} - -// NewRequiredStatusChecksRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. -func NewRequiredStatusChecksRule(params *RequiredStatusChecksRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "required_status_checks", - Parameters: &rawParams, - } -} - -// NewNonFastForwardRule creates a rule as part to prevent users with push access from force pushing to matching branches. -func NewNonFastForwardRule() (rule *RepositoryRule) { - return &RepositoryRule{ - Type: "non_fast_forward", - } -} - -// NewCommitMessagePatternRule creates a rule to restrict commit message patterns being pushed to matching branches. -func NewCommitMessagePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "commit_message_pattern", - Parameters: &rawParams, - } -} - -// NewCommitAuthorEmailPatternRule creates a rule to restrict commits with author email patterns being merged into matching branches. -func NewCommitAuthorEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "commit_author_email_pattern", - Parameters: &rawParams, - } -} - -// NewCommitterEmailPatternRule creates a rule to restrict commits with committer email patterns being merged into matching branches. -func NewCommitterEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "committer_email_pattern", - Parameters: &rawParams, - } -} - -// NewBranchNamePatternRule creates a rule to restrict branch patterns from being merged into matching branches. -func NewBranchNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "branch_name_pattern", - Parameters: &rawParams, - } -} - -// NewTagNamePatternRule creates a rule to restrict tag patterns contained in non-target branches from being merged into matching branches. -func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "tag_name_pattern", - Parameters: &rawParams, - } -} - -// NewRequiredWorkflowsRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. -func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *RepositoryRule) { - bytes, _ := json.Marshal(params) - - rawParams := json.RawMessage(bytes) - - return &RepositoryRule{ - Type: "workflows", - 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 - Target *string `json:"target,omitempty"` - // Possible values for SourceType are: Repository, Organization - SourceType *string `json:"source_type,omitempty"` - Source string `json:"source"` - // Possible values for Enforcement are: disabled, active, evaluate - Enforcement string `json:"enforcement"` - BypassActors []*BypassActor `json:"bypass_actors,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Links *RulesetLinks `json:"_links,omitempty"` - Conditions *RulesetConditions `json:"conditions,omitempty"` - Rules []*RepositoryRule `json:"rules,omitempty"` -} - -// GetRulesForBranch gets all the rules that apply to the specified branch. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch -// -//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} -func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var rules []*RepositoryRule - resp, err := s.client.Do(ctx, req, &rules) - if err != nil { - return nil, resp, err - } - - return rules, resp, nil -} - -// GetAllRulesets gets all the rules that apply to the specified repository. -// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets -// -//meta:operation GET /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset []*Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// CreateRuleset creates a ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset -// -//meta:operation POST /repos/{owner}/{repo}/rulesets -func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) - - req, err := s.client.NewRequest("POST", u, rs) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// GetRuleset gets a ruleset for the specified repository. -// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset -// -//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// UpdateRuleset updates a ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset -// -//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - req, err := s.client.NewRequest("PUT", u, rs) - if err != nil { - return nil, nil, err - } - - var ruleset *Ruleset - resp, err := s.client.Do(ctx, req, &ruleset) - if err != nil { - return nil, resp, err - } - - return ruleset, resp, nil -} - -// DeleteRuleset deletes a ruleset for the specified repository. -// -// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset -// -//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} -func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) - - req, err := s.client.NewRequest("DELETE", u, nil) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} diff --git a/vendor/github.com/google/go-github/v59/AUTHORS b/vendor/github.com/google/go-github/v67/AUTHORS similarity index 88% rename from vendor/github.com/google/go-github/v59/AUTHORS rename to vendor/github.com/google/go-github/v67/AUTHORS index 74a21dc..bbbdc74 100644 --- a/vendor/github.com/google/go-github/v59/AUTHORS +++ b/vendor/github.com/google/go-github/v67/AUTHORS @@ -13,10 +13,14 @@ 413x 6543 <6543@obermui.de> Abed Kibbe +Abhijit Hota Abhinav Gupta +abhishek +Abhishek Sharma Abhishek Veeramalla aboy Adam Kohring +Aditya Mahendrakar adrienzieba afdesk Ahmad Nurus S @@ -35,19 +39,25 @@ 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 Gillis Andrew Ryabchun Andrew Svoboda +Andriyun Andy Grunwald Andy Hume Andy Lindeman angie pinilla +Anish Rajan anjanashenoy Anshuman Bhartiya Antoine @@ -59,6 +69,7 @@ aprp apurwaj2 Aravind Arda Kuyumcu +Ary Arıl Bozoluk Asier Marruedo Austin Burdine @@ -66,9 +77,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,11 +106,13 @@ Cami Diez Carl Johnson Carlos Alexandro Becker Carlos Tadeu Panato Junior +Casey ChandanChainani chandresh-pancholi Charles Fenwick Elliott Charlie Yan Chmouel Boudjnah +Chris Allen Lane Chris King Chris Mc Chris Raborg @@ -109,6 +124,7 @@ Christian Muehlhaeuser Christoph Jerolimov Christoph Sassenberg CI Monk +Clemens W Colin Misare Craig Gumbley Craig Peterson @@ -137,6 +153,7 @@ DeviousLab Dhi Aurrahman Diego Lapiduz Diogo Vilela +Dion Gionet Mallet Dmitri Shuralyov dmnlk Don Petersen @@ -149,10 +166,14 @@ Eli Uriegas Elliott Beach Emerson Wood Emil V +Emma Sax Eng Zer Jun +Enrico Candino eperm Erick Fejta +Erik Elkins Erik Nobel +Erwan Finot erwinvaneyk Evan Anderson Evan Elias @@ -163,6 +184,7 @@ Federico Di Pierro Felix Geisendörfer Filippo Valsorda Florian Forster +Florian Maier Florian Wagner Francesc Gil Francis @@ -178,6 +200,7 @@ Glen Mailer Gnahz Google Inc. Grachev Mikhail +Gregory Oschwald griffin_stewie guangwu Guillaume Jacquet @@ -188,6 +211,7 @@ Hari haran Harikesh00 haya14busa haya14busa +Henrik Lundström Hiroki Ito Hubot Jr Huy Tr @@ -200,8 +224,10 @@ Ioannis Georgoulas Isao Jonas ishan upadhyay isqua +Ivan Martos Jacob Valdemar Jake Krammer +Jake Scaltreto Jake White Jameel Haffejee James Bowes @@ -210,6 +236,7 @@ James Loh James Maguire James Turley Jamie West +Jan Guth Jan Kosecki Jan Švábík Jason Field @@ -224,6 +251,7 @@ Jihoon Chung Jille Timmermans Jimmi Dyson Joan Saum +JoannaaKL Joe Tsai John Barton John Engelman @@ -232,6 +260,7 @@ John Liu Jordan Brockopp Jordan Burandt Jordan Sussman +Jorge Ferrero Jorge Gómez Reus Joshua Bezaleel Abednego João Cerqueira @@ -240,6 +269,7 @@ jpbelanger-mtl Juan Juan Basso Julien Garcia Gonzalez +Julien Midedji Julien Rostand Junya Kono Justin Abrahms @@ -257,6 +287,7 @@ Kevin Burke Kevin Wang Kevin Zhao kgalli +Khanh Ngo Kirill Konrad Malawski Kookheon Kwon @@ -266,10 +297,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 +316,8 @@ Luke Kysow Luke Roberts Luke Young lynn [they] +Léo Salé +M. Ryan Rigdon Magnus Kulke Maksim Zhylinski Marc Binder @@ -294,6 +329,7 @@ Martins Sipenko Marwan Sulaiman Masayuki Izumi Mat Geist +Matheus Santos Araújo Matija Horvat Matin Rahmanian Matt @@ -301,8 +337,10 @@ Matt Brender Matt Dainty Matt Gaunt Matt Landis +Matt Mencel Matt Moore Matt Simons +Matthew Reidy Maxime Bury Michael Meng Michael Spiegel @@ -311,8 +349,12 @@ Michał Glapa Michelangelo Morrillo Miguel Elias dos Santos Mike Chen +Miles Crabill +Mishin Nikolai mohammad ali <2018cs92@student.uet.edu.pk> Mohammed AlDujaili +Mohammed Nafees +Mudit Mukundan Senthil Munia Balayil Mustafa Abban @@ -320,20 +362,25 @@ 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 Oleg Kovalov +Oleksandr Redko Ondřej Kupka Ori Talmor Osama Faqhruldin @@ -357,6 +404,7 @@ Pierce McEntagart Pierre Carrier Piotr Zurek Piyush Chugh +Pj Meyer Pratik Mallya Qais Patankar Quang Le Hong @@ -369,6 +417,7 @@ Rafael Aramizu Gomes Rajat Jindal Rajendra arora Rajkumar +Ramesh Gaikwad Ranbir Singh Ravi Shekhar Jethani RaviTeja Pothana @@ -378,18 +427,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 @@ -430,6 +484,7 @@ Steve Teuber Stian Eikeland Suhaib Mujahid sushmita wable +Sven Palberg Szymon Kodrebski Søren Hansen T.J. Corrigan @@ -450,6 +505,9 @@ Tingluo Huang tkhandel Tobias Gesellchen Tom Payne +Tomasz Adam Skrzypczak +tomfeigin +Travis Tomsu Trey Tacon tsbkw ttacon @@ -481,6 +539,7 @@ Yurii Soldak Yusef Mohamadi Yusuke Kuoka Zach Latta +Ze Peng zhouhaibing089 六开箱 缘生 diff --git a/vendor/github.com/google/go-github/v59/LICENSE b/vendor/github.com/google/go-github/v67/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v59/LICENSE rename to vendor/github.com/google/go-github/v67/LICENSE diff --git a/vendor/github.com/google/go-github/v59/github/actions.go b/vendor/github.com/google/go-github/v67/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions.go rename to vendor/github.com/google/go-github/v67/github/actions.go diff --git a/vendor/github.com/google/go-github/v59/github/actions_artifacts.go b/vendor/github.com/google/go-github/v67/github/actions_artifacts.go similarity index 93% rename from vendor/github.com/google/go-github/v59/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v67/github/actions_artifacts.go index f804b80..e05a9a8 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/actions_cache.go b/vendor/github.com/google/go-github/v67/github/actions_cache.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/actions_cache.go rename to vendor/github.com/google/go-github/v67/github/actions_cache.go index 271d7d8..852e986 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_cache.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/actions_oidc.go b/vendor/github.com/google/go-github/v67/github/actions_oidc.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions_oidc.go rename to vendor/github.com/google/go-github/v67/github/actions_oidc.go diff --git a/vendor/github.com/google/go-github/v59/github/actions_permissions_enterprise.go b/vendor/github.com/google/go-github/v67/github/actions_permissions_enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions_permissions_enterprise.go rename to vendor/github.com/google/go-github/v67/github/actions_permissions_enterprise.go diff --git a/vendor/github.com/google/go-github/v59/github/actions_permissions_orgs.go b/vendor/github.com/google/go-github/v67/github/actions_permissions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions_permissions_orgs.go rename to vendor/github.com/google/go-github/v67/github/actions_permissions_orgs.go diff --git a/vendor/github.com/google/go-github/v59/github/actions_required_workflows.go b/vendor/github.com/google/go-github/v67/github/actions_required_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions_required_workflows.go rename to vendor/github.com/google/go-github/v67/github/actions_required_workflows.go diff --git a/vendor/github.com/google/go-github/v59/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v67/github/actions_runner_groups.go similarity index 84% rename from vendor/github.com/google/go-github/v59/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v67/github/actions_runner_groups.go index a1f453f..b2ee32f 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_runner_groups.go +++ b/vendor/github.com/google/go-github/v67/github/actions_runner_groups.go @@ -80,7 +80,7 @@ type ListOrgRunnerGroupOptions struct { // ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) { @@ -106,7 +106,7 @@ func (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org s // GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) { @@ -127,7 +127,7 @@ func (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org str // DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) { @@ -143,7 +143,7 @@ func (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org // CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization // //meta:operation POST /orgs/{org}/actions/runner-groups func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -164,7 +164,7 @@ func (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org // UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization // //meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id} func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) { @@ -185,7 +185,7 @@ func (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org // ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) { @@ -212,7 +212,7 @@ func (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, or // SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization // with a new List of repositories. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) { @@ -229,7 +229,7 @@ func (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org // AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -246,7 +246,7 @@ func (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org // RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group. // The runner group must have visibility set to 'selected'. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id} func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) { @@ -262,7 +262,7 @@ func (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, // ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization // //meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) { @@ -289,7 +289,7 @@ func (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, // SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group // with a new list of runners. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) { @@ -305,7 +305,7 @@ func (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, // AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization // //meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { @@ -322,7 +322,7 @@ func (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, // RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization. // The runner is then returned to the default group. // -// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization // //meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id} func (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v59/github/actions_runners.go b/vendor/github.com/google/go-github/v67/github/actions_runners.go similarity index 91% rename from vendor/github.com/google/go-github/v59/github/actions_runners.go rename to vendor/github.com/google/go-github/v67/github/actions_runners.go index 90cf580..c4ae482 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_runners.go +++ b/vendor/github.com/google/go-github/v67/github/actions_runners.go @@ -63,8 +63,8 @@ type JITRunnerConfig struct { // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig -func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, owner string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", owner) +func (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/generate-jitconfig", org) req, err := s.client.NewRequest("POST", u, request) if err != nil { return nil, nil, err @@ -151,12 +151,18 @@ type Runners struct { Runners []*Runner `json:"runners"` } +// ListRunnersOptions specifies the optional parameters to the ListRunners and ListOrganizationRunners methods. +type ListRunnersOptions struct { + Name *string `url:"name,omitempty"` + ListOptions +} + // ListRunners lists all the self-hosted runners for a repository. // // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/actions/runners -func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListOptions) (*Runners, *Response, error) { +func (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runners", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -247,8 +253,8 @@ func (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, r // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/downloads -func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, owner string) ([]*RunnerApplicationDownload, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/downloads", owner) +func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/downloads", org) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -268,8 +274,8 @@ func (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context. // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/registration-token -func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*RegistrationToken, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", owner) +func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/registration-token", org) req, err := s.client.NewRequest("POST", u, nil) if err != nil { @@ -290,8 +296,8 @@ func (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners -func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner string, opts *ListOptions) (*Runners, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners", owner) +func (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners", org) u, err := addOptions(u, opts) if err != nil { return nil, nil, err @@ -316,8 +322,8 @@ func (s *ActionsService) ListOrganizationRunners(ctx context.Context, owner stri // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization // //meta:operation GET /orgs/{org}/actions/runners/{runner_id} -func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Runner, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) +func (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/%v", org, runnerID) req, err := s.client.NewRequest("GET", u, nil) if err != nil { return nil, nil, err @@ -337,8 +343,8 @@ func (s *ActionsService) GetOrganizationRunner(ctx context.Context, owner string // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization // //meta:operation POST /orgs/{org}/actions/runners/remove-token -func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owner string) (*RemoveToken, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", owner) +func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/remove-token", org) req, err := s.client.NewRequest("POST", u, nil) if err != nil { @@ -359,8 +365,8 @@ func (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, owne // GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization // //meta:operation DELETE /orgs/{org}/actions/runners/{runner_id} -func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, owner string, runnerID int64) (*Response, error) { - u := fmt.Sprintf("orgs/%v/actions/runners/%v", owner, runnerID) +func (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/runners/%v", org, runnerID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v59/github/actions_secrets.go b/vendor/github.com/google/go-github/v67/github/actions_secrets.go similarity index 96% rename from vendor/github.com/google/go-github/v59/github/actions_secrets.go rename to vendor/github.com/google/go-github/v67/github/actions_secrets.go index d8d405c..ec51983 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v67/github/actions_secrets.go @@ -84,7 +84,7 @@ func (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*Publ // GetEnvPublicKey gets a public key that should be used for secret encryption. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-public-key // //meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key func (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) { @@ -162,7 +162,7 @@ func (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *L // ListEnvSecrets lists all secrets available in an environment. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-environment-secrets +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets // //meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets func (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) { @@ -207,7 +207,7 @@ func (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*S // GetEnvSecret gets a single environment secret without revealing its encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-environment-secret +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-secret // //meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) { @@ -262,7 +262,7 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret // //meta:operation PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) { @@ -301,7 +301,7 @@ func (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) // DeleteEnvSecret deletes a secret in an environment using the secret name. // -// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret +// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#delete-an-environment-secret // //meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name} func (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) { diff --git a/vendor/github.com/google/go-github/v59/github/actions_variables.go b/vendor/github.com/google/go-github/v67/github/actions_variables.go similarity index 89% rename from vendor/github.com/google/go-github/v59/github/actions_variables.go rename to vendor/github.com/google/go-github/v67/github/actions_variables.go index aa0f23c..bca46b6 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_variables.go +++ b/vendor/github.com/google/go-github/v67/github/actions_variables.go @@ -83,9 +83,9 @@ func (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts // // GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables // -//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables -func (s *ActionsService) ListEnvVariables(ctx context.Context, repoID int, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables +func (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables", owner, repo, env) return s.listVariables(ctx, url, opts) } @@ -128,9 +128,9 @@ func (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) ( // // GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable // -//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/variables/{name} -func (s *ActionsService) GetEnvVariable(ctx context.Context, repoID int, env, variableName string) (*ActionsVariable, *Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) +//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} +func (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variableName) return s.getVariable(ctx, url) } @@ -166,9 +166,9 @@ func (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, vari // // GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable // -//meta:operation POST /repositories/{repository_id}/environments/{environment_name}/variables -func (s *ActionsService) CreateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables", repoID, env) +//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables +func (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables", owner, repo, env) return s.postVariable(ctx, url, variable) } @@ -204,9 +204,9 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // // GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable // -//meta:operation PATCH /repositories/{repository_id}/environments/{environment_name}/variables/{name} -func (s *ActionsService) UpdateEnvVariable(ctx context.Context, repoID int, env string, variable *ActionsVariable) (*Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variable.Name) +//meta:operation PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} +func (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variable.Name) return s.patchVariable(ctx, url, variable) } @@ -243,9 +243,9 @@ func (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string // // GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable // -//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/variables/{name} -func (s *ActionsService) DeleteEnvVariable(ctx context.Context, repoID int, env, variableName string) (*Response, error) { - url := fmt.Sprintf("repositories/%v/environments/%v/variables/%v", repoID, env, variableName) +//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name} +func (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error) { + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variableName) return s.deleteVariable(ctx, url) } diff --git a/vendor/github.com/google/go-github/v59/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v67/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v67/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v59/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v67/github/actions_workflow_runs.go similarity index 84% rename from vendor/github.com/google/go-github/v59/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v67/github/actions_workflow_runs.go index bc7afe9..122ea1d 100644 --- a/vendor/github.com/google/go-github/v59/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v67/github/actions_workflow_runs.go @@ -19,6 +19,7 @@ type WorkflowRun struct { NodeID *string `json:"node_id,omitempty"` HeadBranch *string `json:"head_branch,omitempty"` HeadSHA *string `json:"head_sha,omitempty"` + Path *string `json:"path,omitempty"` RunNumber *int `json:"run_number,omitempty"` RunAttempt *int `json:"run_attempt,omitempty"` Event *string `json:"event,omitempty"` @@ -111,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 { @@ -387,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 @@ -408,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/v59/github/actions_workflows.go b/vendor/github.com/google/go-github/v67/github/actions_workflows.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/actions_workflows.go rename to vendor/github.com/google/go-github/v67/github/actions_workflows.go diff --git a/vendor/github.com/google/go-github/v59/github/activity.go b/vendor/github.com/google/go-github/v67/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/activity.go rename to vendor/github.com/google/go-github/v67/github/activity.go diff --git a/vendor/github.com/google/go-github/v59/github/activity_events.go b/vendor/github.com/google/go-github/v67/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/activity_events.go rename to vendor/github.com/google/go-github/v67/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v59/github/activity_notifications.go b/vendor/github.com/google/go-github/v67/github/activity_notifications.go similarity index 92% rename from vendor/github.com/google/go-github/v59/github/activity_notifications.go rename to vendor/github.com/google/go-github/v67/github/activity_notifications.go index 47f2226..e712323 100644 --- a/vendor/github.com/google/go-github/v59/github/activity_notifications.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/activity_star.go b/vendor/github.com/google/go-github/v67/github/activity_star.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/activity_star.go rename to vendor/github.com/google/go-github/v67/github/activity_star.go diff --git a/vendor/github.com/google/go-github/v59/github/activity_watching.go b/vendor/github.com/google/go-github/v67/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/activity_watching.go rename to vendor/github.com/google/go-github/v67/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v59/github/admin.go b/vendor/github.com/google/go-github/v67/github/admin.go similarity index 97% rename from vendor/github.com/google/go-github/v59/github/admin.go rename to vendor/github.com/google/go-github/v67/github/admin.go index c1f7066..adf55d6 100644 --- a/vendor/github.com/google/go-github/v59/github/admin.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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/v59/github/admin_orgs.go b/vendor/github.com/google/go-github/v67/github/admin_orgs.go similarity index 93% rename from vendor/github.com/google/go-github/v59/github/admin_orgs.go rename to vendor/github.com/google/go-github/v67/github/admin_orgs.go index e1b3641..8b50756 100644 --- a/vendor/github.com/google/go-github/v59/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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/v59/github/admin_stats.go b/vendor/github.com/google/go-github/v67/github/admin_stats.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/admin_stats.go rename to vendor/github.com/google/go-github/v67/github/admin_stats.go index f26b393..f012d79 100644 --- a/vendor/github.com/google/go-github/v59/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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/v59/github/admin_users.go b/vendor/github.com/google/go-github/v67/github/admin_users.go similarity index 94% rename from vendor/github.com/google/go-github/v59/github/admin_users.go rename to vendor/github.com/google/go-github/v67/github/admin_users.go index e134ff3..6877cef 100644 --- a/vendor/github.com/google/go-github/v59/github/admin_users.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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/v59/github/apps.go b/vendor/github.com/google/go-github/v67/github/apps.go similarity index 70% rename from vendor/github.com/google/go-github/v59/github/apps.go rename to vendor/github.com/google/go-github/v67/github/apps.go index f0392f2..4757ded 100644 --- a/vendor/github.com/google/go-github/v59/github/apps.go +++ b/vendor/github.com/google/go-github/v67/github/apps.go @@ -56,6 +56,20 @@ type InstallationTokenOptions struct { Permissions *InstallationPermissions `json:"permissions,omitempty"` } +type InstallationTokenListRepoOptions struct { + // The IDs of the repositories that the installation token can access. + // Providing repository IDs restricts the access of an installation token to specific repositories. + RepositoryIDs []int64 `json:"repository_ids"` + + // The names of the repositories that the installation token can access. + // Providing repository names restricts the access of an installation token to specific repositories. + Repositories []string `json:"repositories,omitempty"` + + // The permissions granted to the access token. + // The permissions object includes the permission names and their access type. + Permissions *InstallationPermissions `json:"permissions,omitempty"` +} + // InstallationPermissions lists the repository and organization permissions for an installation. // // Permission names taken from: @@ -63,43 +77,57 @@ type InstallationTokenOptions struct { // https://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app // https://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app type InstallationPermissions struct { - Actions *string `json:"actions,omitempty"` - Administration *string `json:"administration,omitempty"` - Blocking *string `json:"blocking,omitempty"` - Checks *string `json:"checks,omitempty"` - Contents *string `json:"contents,omitempty"` - ContentReferences *string `json:"content_references,omitempty"` - Deployments *string `json:"deployments,omitempty"` - Emails *string `json:"emails,omitempty"` - Environments *string `json:"environments,omitempty"` - Followers *string `json:"followers,omitempty"` - Issues *string `json:"issues,omitempty"` - Metadata *string `json:"metadata,omitempty"` - Members *string `json:"members,omitempty"` - OrganizationAdministration *string `json:"organization_administration,omitempty"` - OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` - OrganizationHooks *string `json:"organization_hooks,omitempty"` - OrganizationPackages *string `json:"organization_packages,omitempty"` - OrganizationPlan *string `json:"organization_plan,omitempty"` - OrganizationPreReceiveHooks *string `json:"organization_pre_receive_hooks,omitempty"` - OrganizationProjects *string `json:"organization_projects,omitempty"` - OrganizationSecrets *string `json:"organization_secrets,omitempty"` - OrganizationSelfHostedRunners *string `json:"organization_self_hosted_runners,omitempty"` - OrganizationUserBlocking *string `json:"organization_user_blocking,omitempty"` - Packages *string `json:"packages,omitempty"` - Pages *string `json:"pages,omitempty"` - PullRequests *string `json:"pull_requests,omitempty"` - RepositoryHooks *string `json:"repository_hooks,omitempty"` - RepositoryProjects *string `json:"repository_projects,omitempty"` - RepositoryPreReceiveHooks *string `json:"repository_pre_receive_hooks,omitempty"` - Secrets *string `json:"secrets,omitempty"` - SecretScanningAlerts *string `json:"secret_scanning_alerts,omitempty"` - SecurityEvents *string `json:"security_events,omitempty"` - SingleFile *string `json:"single_file,omitempty"` - Statuses *string `json:"statuses,omitempty"` - TeamDiscussions *string `json:"team_discussions,omitempty"` - VulnerabilityAlerts *string `json:"vulnerability_alerts,omitempty"` - Workflows *string `json:"workflows,omitempty"` + Actions *string `json:"actions,omitempty"` + ActionsVariables *string `json:"actions_variables,omitempty"` + Administration *string `json:"administration,omitempty"` + Blocking *string `json:"blocking,omitempty"` + Checks *string `json:"checks,omitempty"` + Codespaces *string `json:"codespaces,omitempty"` + CodespacesLifecycleAdmin *string `json:"codespaces_lifecycle_admin,omitempty"` + CodespacesMetadata *string `json:"codespaces_metadata,omitempty"` + CodespacesSecrets *string `json:"codespaces_secrets,omitempty"` + Contents *string `json:"contents,omitempty"` + ContentReferences *string `json:"content_references,omitempty"` + DependabotSecrets *string `json:"dependabot_secrets,omitempty"` + Deployments *string `json:"deployments,omitempty"` + Discussions *string `json:"discussions,omitempty"` + Emails *string `json:"emails,omitempty"` + Environments *string `json:"environments,omitempty"` + Followers *string `json:"followers,omitempty"` + Issues *string `json:"issues,omitempty"` + Metadata *string `json:"metadata,omitempty"` + Members *string `json:"members,omitempty"` + MergeQueues *string `json:"merge_queues,omitempty"` + OrganizationAdministration *string `json:"organization_administration,omitempty"` + OrganizationCustomProperties *string `json:"organization_custom_properties,omitempty"` + OrganizationCustomRoles *string `json:"organization_custom_roles,omitempty"` + OrganizationCustomOrgRoles *string `json:"organization_custom_org_roles,omitempty"` + OrganizationHooks *string `json:"organization_hooks,omitempty"` + OrganizationPackages *string `json:"organization_packages,omitempty"` + OrganizationPersonalAccessTokens *string `json:"organization_personal_access_tokens,omitempty"` + OrganizationPersonalAccessTokenRequests *string `json:"organization_personal_access_token_requests,omitempty"` + OrganizationPlan *string `json:"organization_plan,omitempty"` + OrganizationPreReceiveHooks *string `json:"organization_pre_receive_hooks,omitempty"` + OrganizationProjects *string `json:"organization_projects,omitempty"` + OrganizationSecrets *string `json:"organization_secrets,omitempty"` + OrganizationSelfHostedRunners *string `json:"organization_self_hosted_runners,omitempty"` + OrganizationUserBlocking *string `json:"organization_user_blocking,omitempty"` + Packages *string `json:"packages,omitempty"` + Pages *string `json:"pages,omitempty"` + PullRequests *string `json:"pull_requests,omitempty"` + RepositoryAdvisories *string `json:"repository_advisories,omitempty"` + RepositoryCustomProperties *string `json:"repository_custom_properties,omitempty"` + RepositoryHooks *string `json:"repository_hooks,omitempty"` + RepositoryProjects *string `json:"repository_projects,omitempty"` + RepositoryPreReceiveHooks *string `json:"repository_pre_receive_hooks,omitempty"` + Secrets *string `json:"secrets,omitempty"` + SecretScanningAlerts *string `json:"secret_scanning_alerts,omitempty"` + SecurityEvents *string `json:"security_events,omitempty"` + SingleFile *string `json:"single_file,omitempty"` + Statuses *string `json:"statuses,omitempty"` + TeamDiscussions *string `json:"team_discussions,omitempty"` + VulnerabilityAlerts *string `json:"vulnerability_alerts,omitempty"` + Workflows *string `json:"workflows,omitempty"` } // InstallationRequest represents a pending GitHub App installation request. @@ -343,6 +371,30 @@ func (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opt return t, resp, nil } +// CreateInstallationTokenListRepos creates a new installation token with a list of all repositories in an installation which is not possible with CreateInstallationToken. +// +// It differs from CreateInstallationToken by taking InstallationTokenListRepoOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array. +// +// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app +// +//meta:operation POST /app/installations/{installation_id}/access_tokens +func (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id int64, opts *InstallationTokenListRepoOptions) (*InstallationToken, *Response, error) { + u := fmt.Sprintf("app/installations/%v/access_tokens", id) + + req, err := s.client.NewRequest("POST", u, opts) + if err != nil { + return nil, nil, err + } + + t := new(InstallationToken) + resp, err := s.client.Do(ctx, req, t) + if err != nil { + return nil, resp, err + } + + return t, resp, nil +} + // CreateAttachment creates a new attachment on user comment containing a url. // // GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment diff --git a/vendor/github.com/google/go-github/v59/github/apps_hooks.go b/vendor/github.com/google/go-github/v67/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/apps_hooks.go rename to vendor/github.com/google/go-github/v67/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v59/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v67/github/apps_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v67/github/apps_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v59/github/apps_installation.go b/vendor/github.com/google/go-github/v67/github/apps_installation.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/apps_installation.go rename to vendor/github.com/google/go-github/v67/github/apps_installation.go diff --git a/vendor/github.com/google/go-github/v59/github/apps_manifest.go b/vendor/github.com/google/go-github/v67/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/apps_manifest.go rename to vendor/github.com/google/go-github/v67/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v59/github/apps_marketplace.go b/vendor/github.com/google/go-github/v67/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v67/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v67/github/attestations.go b/vendor/github.com/google/go-github/v67/github/attestations.go new file mode 100644 index 0000000..618d5d7 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/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/v59/github/authorizations.go b/vendor/github.com/google/go-github/v67/github/authorizations.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/authorizations.go rename to vendor/github.com/google/go-github/v67/github/authorizations.go index 931b772..8b8a67d 100644 --- a/vendor/github.com/google/go-github/v59/github/authorizations.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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/v59/github/billing.go b/vendor/github.com/google/go-github/v67/github/billing.go similarity index 93% rename from vendor/github.com/google/go-github/v59/github/billing.go rename to vendor/github.com/google/go-github/v67/github/billing.go index 6d7579b..09b1a5d 100644 --- a/vendor/github.com/google/go-github/v59/github/billing.go +++ b/vendor/github.com/google/go-github/v67/github/billing.go @@ -43,8 +43,11 @@ type StorageBilling struct { // ActiveCommitters represents the total active committers across all repositories in an Organization. type ActiveCommitters struct { - TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"` - Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"` + TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"` + TotalCount int `json:"total_count"` + MaximumAdvancedSecurityCommitters int `json:"maximum_advanced_security_committers"` + PurchasedAdvancedSecurityCommitters int `json:"purchased_advanced_security_committers"` + Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"` } // RepositoryActiveCommitters represents active committers on each repository. diff --git a/vendor/github.com/google/go-github/v59/github/checks.go b/vendor/github.com/google/go-github/v67/github/checks.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/checks.go rename to vendor/github.com/google/go-github/v67/github/checks.go index a861894..711be20 100644 --- a/vendor/github.com/google/go-github/v59/github/checks.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/code-scanning.go b/vendor/github.com/google/go-github/v67/github/code_scanning.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/code-scanning.go rename to vendor/github.com/google/go-github/v67/github/code_scanning.go diff --git a/vendor/github.com/google/go-github/v59/github/codesofconduct.go b/vendor/github.com/google/go-github/v67/github/codesofconduct.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/codesofconduct.go rename to vendor/github.com/google/go-github/v67/github/codesofconduct.go index 7d7f9ef..aba0574 100644 --- a/vendor/github.com/google/go-github/v59/github/codesofconduct.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/codespaces.go b/vendor/github.com/google/go-github/v67/github/codespaces.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/codespaces.go rename to vendor/github.com/google/go-github/v67/github/codespaces.go diff --git a/vendor/github.com/google/go-github/v59/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v67/github/codespaces_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v67/github/codespaces_secrets.go diff --git a/vendor/github.com/google/go-github/v67/github/copilot.go b/vendor/github.com/google/go-github/v67/github/copilot.go new file mode 100644 index 0000000..a2b2aa0 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/github/copilot.go @@ -0,0 +1,570 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "time" +) + +// CopilotService provides access to the Copilot-related functions +// in the GitHub API. +// +// GitHub API docs: https://docs.github.com/en/rest/copilot/ +type CopilotService service + +// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription. +type CopilotOrganizationDetails struct { + SeatBreakdown *CopilotSeatBreakdown `json:"seat_breakdown"` + PublicCodeSuggestions string `json:"public_code_suggestions"` + CopilotChat string `json:"copilot_chat"` + SeatManagementSetting string `json:"seat_management_setting"` +} + +// CopilotSeatBreakdown represents the breakdown of Copilot for Business seats for the organization. +type CopilotSeatBreakdown struct { + Total int `json:"total"` + AddedThisCycle int `json:"added_this_cycle"` + PendingCancellation int `json:"pending_cancellation"` + PendingInvitation int `json:"pending_invitation"` + ActiveThisCycle int `json:"active_this_cycle"` + InactiveThisCycle int `json:"inactive_this_cycle"` +} + +// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization. +type ListCopilotSeatsResponse struct { + TotalSeats int64 `json:"total_seats"` + Seats []*CopilotSeatDetails `json:"seats"` +} + +// CopilotSeatDetails represents the details of a Copilot for Business seat. +type CopilotSeatDetails struct { + // Assignee can either be a User, Team, or Organization. + Assignee interface{} `json:"assignee"` + AssigningTeam *Team `json:"assigning_team,omitempty"` + PendingCancellationDate *string `json:"pending_cancellation_date,omitempty"` + LastActivityAt *Timestamp `json:"last_activity_at,omitempty"` + 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. +type SeatAssignments struct { + SeatsCreated int `json:"seats_created"` +} + +// SeatCancellations represents the number of seats cancelled. +type SeatCancellations struct { + SeatsCancelled int `json:"seats_cancelled"` +} + +// CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods. +type CopilotMetricsListOptions struct { + Since *time.Time `url:"since,omitempty"` + Until *time.Time `url:"until,omitempty"` + + ListOptions +} + +// CopilotIDECodeCompletionsLanguage represents Copilot usage metrics for completions in the IDE for a language. +type CopilotIDECodeCompletionsLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotIDECodeCompletionsModelLanguage represents Copilot usage metrics for completions in the IDE for a model and language. +type CopilotIDECodeCompletionsModelLanguage struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalCodeSuggestions int `json:"total_code_suggestions"` + TotalCodeAcceptances int `json:"total_code_acceptances"` + TotalCodeLinesSuggested int `json:"total_code_lines_suggested"` + TotalCodeLinesAccepted int `json:"total_code_lines_accepted"` +} + +// CopilotIDECodeCompletionsModel represents Copilot usage metrics for completions in the IDE for a model. +type CopilotIDECodeCompletionsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsModelLanguage `json:"languages"` +} + +// CopilotIDECodeCompletionsEditor represents Copilot usage metrics for completions in the IDE for an editor. +type CopilotIDECodeCompletionsEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDECodeCompletionsModel `json:"models"` +} + +// CopilotIDECodeCompletions represents Copilot usage metrics for Copilot code completions in the IDE, categorized by editor, model and language. +type CopilotIDECodeCompletions struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Languages []*CopilotIDECodeCompletionsLanguage `json:"languages"` + Editors []*CopilotIDECodeCompletionsEditor `json:"editors"` +} + +// CopilotIDEChatModel represents Copilot usage metrics for chatting with a model in the IDE. +type CopilotIDEChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` + TotalChatInsertionEvents int `json:"total_chat_insertion_events"` + TotalChatCopyEvents int `json:"total_chat_copy_events"` +} + +// CopilotIDEChatEditor represents Copilot usage metrics for chatting with a model in the IDE, categorized by editor and model. +type CopilotIDEChatEditor struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotIDEChatModel `json:"models"` +} + +// CopilotIDEChat represents Copilot usage metrics for Copilot Chat in the IDE, categorized by editor and model. +type CopilotIDEChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Editors []*CopilotIDEChatEditor `json:"editors"` +} + +// CopilotDotcomChatModel represents Copilot usage metrics for chatting with a model in the webbrowser. +type CopilotDotcomChatModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalEngagedUsers int `json:"total_engaged_users"` + TotalChats int `json:"total_chats"` +} + +// CopilotDotcomChat represents Copilot usage metrics for Copilot Chat in the webbrowser, categorized by model. +type CopilotDotcomChat struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomChatModel `json:"models"` +} + +// CopilotDotcomPullRequestsModel represents Copilot usage metrics for pull requests in the webbrowser, categorized by model. +type CopilotDotcomPullRequestsModel struct { + Name string `json:"name"` + IsCustomModel bool `json:"is_custom_model"` + CustomModelTrainingDate *string `json:"custom_model_training_date,omitempty"` + TotalPRSummariesCreated int `json:"total_pr_summaries_created"` + TotalEngagedUsers int `json:"total_engaged_users"` +} + +// CopilotDotcomPullRequestsRepository represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository. +type CopilotDotcomPullRequestsRepository struct { + Name string `json:"name"` + TotalEngagedUsers int `json:"total_engaged_users"` + Models []*CopilotDotcomPullRequestsModel `json:"models"` +} + +// CopilotDotcomPullRequests represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository and model. +type CopilotDotcomPullRequests struct { + TotalEngagedUsers int `json:"total_engaged_users"` + Repositories []*CopilotDotcomPullRequestsRepository `json:"repositories"` +} + +// CopilotMetrics represents Copilot usage metrics for a given day. +type CopilotMetrics struct { + Date string `json:"date"` + TotalActiveUsers *int `json:"total_active_users,omitempty"` + TotalEngagedUsers *int `json:"total_engaged_users,omitempty"` + CopilotIDECodeCompletions *CopilotIDECodeCompletions `json:"copilot_ide_code_completions,omitempty"` + CopilotIDEChat *CopilotIDEChat `json:"copilot_ide_chat,omitempty"` + CopilotDotcomChat *CopilotDotcomChat `json:"copilot_dotcom_chat,omitempty"` + CopilotDotcomPullRequests *CopilotDotcomPullRequests `json:"copilot_dotcom_pull_requests,omitempty"` +} + +func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { + // Using an alias to avoid infinite recursion when calling json.Unmarshal + type alias CopilotSeatDetails + var seatDetail alias + + if err := json.Unmarshal(data, &seatDetail); err != nil { + return err + } + + cp.AssigningTeam = seatDetail.AssigningTeam + cp.PendingCancellationDate = seatDetail.PendingCancellationDate + cp.LastActivityAt = seatDetail.LastActivityAt + 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{}: + jsonData, err := json.Marshal(seatDetail.Assignee) + if err != nil { + return err + } + + if v["type"] == nil { + return errors.New("assignee type field is not set") + } + + if t, ok := v["type"].(string); ok && t == "User" { + user := &User{} + if err := json.Unmarshal(jsonData, user); err != nil { + return err + } + cp.Assignee = user + } else if t, ok := v["type"].(string); ok && t == "Team" { + team := &Team{} + if err := json.Unmarshal(jsonData, team); err != nil { + return err + } + cp.Assignee = team + } else if t, ok := v["type"].(string); ok && t == "Organization" { + organization := &Organization{} + if err := json.Unmarshal(jsonData, organization); err != nil { + return err + } + cp.Assignee = organization + } else { + return fmt.Errorf("unsupported assignee type %v", v["type"]) + } + default: + return fmt.Errorf("unsupported assignee type %T", v) + } + + return nil +} + +// GetUser gets the User from the CopilotSeatDetails if the assignee is a user. +func (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*User); return u, ok } + +// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team. +func (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { t, ok := cp.Assignee.(*Team); return t, ok } + +// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization. +func (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) { + o, ok := cp.Assignee.(*Organization) + return o, ok +} + +// GetCopilotBilling gets Copilot for Business billing information and settings for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/billing +func (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var copilotDetails *CopilotOrganizationDetails + resp, err := s.client.Do(ctx, req, &copilotDetails) + if err != nil { + return nil, resp, err + } + + return copilotDetails, resp, nil +} + +// ListCopilotSeats lists Copilot for Business seat assignments for an organization. +// +// 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-organization +// +//meta:operation GET /orgs/{org}/copilot/billing/seats +func (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/seats", 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 copilotSeats *ListCopilotSeatsResponse + resp, err := s.client.Do(ctx, req, &copilotSeats) + if err != nil { + return nil, resp, err + } + + 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 +// +//meta:operation POST /orgs/{org}/copilot/billing/selected_teams +func (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + var seatAssignments *SeatAssignments + resp, err := s.client.Do(ctx, req, &seatAssignments) + if err != nil { + return nil, resp, err + } + + return seatAssignments, resp, nil +} + +// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization +// +//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams +func (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_teams", org) + + body := struct { + SelectedTeams []string `json:"selected_teams"` + }{ + SelectedTeams: teamNames, + } + + req, err := s.client.NewRequest("DELETE", u, body) + if err != nil { + return nil, nil, err + } + + var seatCancellations *SeatCancellations + resp, err := s.client.Do(ctx, req, &seatCancellations) + if err != nil { + return nil, resp, err + } + + return seatCancellations, resp, nil +} + +// AddCopilotUsers adds users to the Copilot for Business subscription for an organization +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization +// +//meta:operation POST /orgs/{org}/copilot/billing/selected_users +func (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + body := struct { + SelectedUsernames []string `json:"selected_usernames"` + }{ + SelectedUsernames: users, + } + + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + var seatAssignments *SeatAssignments + resp, err := s.client.Do(ctx, req, &seatAssignments) + if err != nil { + return nil, resp, err + } + + return seatAssignments, resp, nil +} + +// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization +// +//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users +func (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/billing/selected_users", org) + + body := struct { + SelectedUsernames []string `json:"selected_usernames"` + }{ + SelectedUsernames: users, + } + + req, err := s.client.NewRequest("DELETE", u, body) + if err != nil { + return nil, nil, err + } + + var seatCancellations *SeatCancellations + resp, err := s.client.Do(ctx, req, &seatCancellations) + if err != nil { + return nil, resp, err + } + + return seatCancellations, resp, nil +} + +// GetSeatDetails gets Copilot for Business seat assignment details for a user. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user +// +//meta:operation GET /orgs/{org}/members/{username}/copilot +func (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) { + u := fmt.Sprintf("orgs/%v/members/%v/copilot", org, user) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var seatDetails *CopilotSeatDetails + resp, err := s.client.Do(ctx, req, &seatDetails) + if err != nil { + return nil, resp, err + } + + return seatDetails, resp, nil +} + +// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/copilot/metrics +func (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/copilot/metrics", 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 metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team +// +//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("enterprises/%v/team/%v/copilot/metrics", 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 metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetOrganizationMetrics gets Copilot usage metrics for an organization. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization +// +//meta:operation GET /orgs/{org}/copilot/metrics +func (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/copilot/metrics", 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 metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} + +// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team. +// +// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team +// +//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics +func (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) { + u := fmt.Sprintf("orgs/%v/team/%v/copilot/metrics", 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 metrics []*CopilotMetrics + resp, err := s.client.Do(ctx, req, &metrics) + if err != nil { + return nil, resp, err + } + + return metrics, resp, nil +} diff --git a/vendor/github.com/google/go-github/v59/github/dependabot.go b/vendor/github.com/google/go-github/v67/github/dependabot.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/dependabot.go rename to vendor/github.com/google/go-github/v67/github/dependabot.go diff --git a/vendor/github.com/google/go-github/v59/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v67/github/dependabot_alerts.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v67/github/dependabot_alerts.go diff --git a/vendor/github.com/google/go-github/v59/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v67/github/dependabot_secrets.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v67/github/dependabot_secrets.go diff --git a/vendor/github.com/google/go-github/v59/github/dependency_graph.go b/vendor/github.com/google/go-github/v67/github/dependency_graph.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/dependency_graph.go rename to vendor/github.com/google/go-github/v67/github/dependency_graph.go diff --git a/vendor/github.com/google/go-github/v67/github/dependency_graph_snapshots.go b/vendor/github.com/google/go-github/v67/github/dependency_graph_snapshots.go new file mode 100644 index 0000000..0606b98 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/github/dependency_graph_snapshots.go @@ -0,0 +1,113 @@ +// Copyright 2023 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" +) + +// DependencyGraphSnapshotResolvedDependency represents a resolved dependency in a dependency graph snapshot. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotResolvedDependency struct { + PackageURL *string `json:"package_url,omitempty"` + // Represents whether the dependency is requested directly by the manifest or is a dependency of another dependency. + // Can have the following values: + // - "direct": indicates that the dependency is requested directly by the manifest. + // - "indirect": indicates that the dependency is a dependency of another dependency. + Relationship *string `json:"relationship,omitempty"` + // Represents whether the dependency is required for the primary build artifact or is only used for development. + // Can have the following values: + // - "runtime": indicates that the dependency is required for the primary build artifact. + // - "development": indicates that the dependency is only used for development. + Scope *string `json:"scope,omitempty"` + Dependencies []string `json:"dependencies,omitempty"` +} + +// DependencyGraphSnapshotJob represents the job that created the snapshot. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotJob struct { + Correlator *string `json:"correlator,omitempty"` + ID *string `json:"id,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` +} + +// DependencyGraphSnapshotDetector represents a description of the detector used. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotDetector struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + URL *string `json:"url,omitempty"` +} + +// DependencyGraphSnapshotManifestFile represents the file declaring the repository's dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotManifestFile struct { + SourceLocation *string `json:"source_location,omitempty"` +} + +// DependencyGraphSnapshotManifest represents a collection of related dependencies declared in a file or representing a logical group of dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotManifest struct { + Name *string `json:"name,omitempty"` + File *DependencyGraphSnapshotManifestFile `json:"file,omitempty"` + Resolved map[string]*DependencyGraphSnapshotResolvedDependency `json:"resolved,omitempty"` +} + +// DependencyGraphSnapshot represent a snapshot of a repository's dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshot struct { + Version int `json:"version"` + Sha *string `json:"sha,omitempty"` + Ref *string `json:"ref,omitempty"` + Job *DependencyGraphSnapshotJob `json:"job,omitempty"` + Detector *DependencyGraphSnapshotDetector `json:"detector,omitempty"` + Scanned *Timestamp `json:"scanned,omitempty"` + Manifests map[string]*DependencyGraphSnapshotManifest `json:"manifests,omitempty"` +} + +// DependencyGraphSnapshotCreationData represents the dependency snapshot's creation result. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +type DependencyGraphSnapshotCreationData struct { + ID int64 `json:"id"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + Message *string `json:"message,omitempty"` + // Represents the snapshot creation result. + // Can have the following values: + // - "SUCCESS": indicates that the snapshot was successfully created and the repository's dependencies were updated. + // - "ACCEPTED": indicates that the snapshot was successfully created, but the repository's dependencies were not updated. + // - "INVALID": indicates that the snapshot was malformed. + Result *string `json:"result,omitempty"` +} + +// CreateSnapshot creates a new snapshot of a repository's dependencies. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +// +//meta:operation POST /repos/{owner}/{repo}/dependency-graph/snapshots +func (s *DependencyGraphService) CreateSnapshot(ctx context.Context, owner, repo string, dependencyGraphSnapshot *DependencyGraphSnapshot) (*DependencyGraphSnapshotCreationData, *Response, error) { + url := fmt.Sprintf("repos/%v/%v/dependency-graph/snapshots", owner, repo) + + req, err := s.client.NewRequest("POST", url, dependencyGraphSnapshot) + if err != nil { + return nil, nil, err + } + + var snapshotCreationData *DependencyGraphSnapshotCreationData + resp, err := s.client.Do(ctx, req, &snapshotCreationData) + if err != nil { + return nil, resp, err + } + + return snapshotCreationData, resp, nil +} diff --git a/vendor/github.com/google/go-github/v59/github/doc.go b/vendor/github.com/google/go-github/v67/github/doc.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/doc.go rename to vendor/github.com/google/go-github/v67/github/doc.go index 7bb0d18..bee1a61 100644 --- a/vendor/github.com/google/go-github/v59/github/doc.go +++ b/vendor/github.com/google/go-github/v67/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v59/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v67/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/v59/github/emojis.go b/vendor/github.com/google/go-github/v67/github/emojis.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/emojis.go rename to vendor/github.com/google/go-github/v67/github/emojis.go index 93ef232..b7a03dd 100644 --- a/vendor/github.com/google/go-github/v59/github/emojis.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/enterprise.go b/vendor/github.com/google/go-github/v67/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/enterprise.go rename to vendor/github.com/google/go-github/v67/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v59/github/enterprise_actions_runner_groups.go b/vendor/github.com/google/go-github/v67/github/enterprise_actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/enterprise_actions_runner_groups.go rename to vendor/github.com/google/go-github/v67/github/enterprise_actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v59/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v67/github/enterprise_actions_runners.go similarity index 83% rename from vendor/github.com/google/go-github/v59/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v67/github/enterprise_actions_runners.go index 4a6e6b5..fa345ae 100644 --- a/vendor/github.com/google/go-github/v59/github/enterprise_actions_runners.go +++ b/vendor/github.com/google/go-github/v67/github/enterprise_actions_runners.go @@ -80,7 +80,7 @@ func (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterpr // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise // //meta:operation GET /enterprises/{enterprise}/actions/runners -func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListOptions) (*Runners, *Response, error) { +func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListRunnersOptions) (*Runners, *Response, error) { u := fmt.Sprintf("enterprises/%v/actions/runners", enterprise) u, err := addOptions(u, opts) if err != nil { @@ -101,6 +101,27 @@ func (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, return runners, resp, nil } +// GetRunner gets a specific self-hosted runner configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/runners/{runner_id} +func (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, runnerID int64) (*Runner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + runner := new(Runner) + resp, err := s.client.Do(ctx, req, runner) + if err != nil { + return nil, resp, err + } + + return runner, resp, nil +} + // RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise diff --git a/vendor/github.com/google/go-github/v59/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v67/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v67/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v59/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v67/github/enterprise_code_security_and_analysis.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v67/github/enterprise_code_security_and_analysis.go diff --git a/vendor/github.com/google/go-github/v59/github/event.go b/vendor/github.com/google/go-github/v67/github/event.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/event.go rename to vendor/github.com/google/go-github/v67/github/event.go diff --git a/vendor/github.com/google/go-github/v59/github/event_types.go b/vendor/github.com/google/go-github/v67/github/event_types.go similarity index 89% rename from vendor/github.com/google/go-github/v59/github/event_types.go rename to vendor/github.com/google/go-github/v67/github/event_types.go index b820ddd..373d59b 100644 --- a/vendor/github.com/google/go-github/v59/github/event_types.go +++ b/vendor/github.com/google/go-github/v67/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". // @@ -232,6 +285,7 @@ type DeploymentProtectionRuleEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status type DeploymentStatusEvent struct { + Action *string `json:"action,omitempty"` Deployment *Deployment `json:"deployment,omitempty"` DeploymentStatus *DeploymentStatus `json:"deployment_status,omitempty"` Repo *Repository `json:"repository,omitempty"` @@ -689,14 +743,33 @@ type MarketplacePurchaseEvent struct { Org *Organization `json:"organization,omitempty"` } -// MemberEvent is triggered when a user is added as a collaborator to a repository. +// MemberChangesPermission represents changes to a repository collaborator's permissions. +type MemberChangesPermission struct { + From *string `json:"from,omitempty"` + To *string `json:"to,omitempty"` +} + +// MemberChangesRoleName represents changes to a repository collaborator's role. +type MemberChangesRoleName struct { + From *string `json:"from,omitempty"` + To *string `json:"to,omitempty"` +} + +// MemberChanges represents changes to a repository collaborator's role or permission. +type MemberChanges struct { + Permission *MemberChangesPermission `json:"permission,omitempty"` + RoleName *MemberChangesRoleName `json:"role_name,omitempty"` +} + +// MemberEvent is triggered when a user's membership as a collaborator to a repository changes. // The Webhook event name is "member". // // 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 value is: "added". - Action *string `json:"action,omitempty"` - Member *User `json:"member,omitempty"` + // 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"` // The following fields are only populated by Webhook events. Repo *Repository `json:"repository,omitempty"` @@ -1327,44 +1400,44 @@ func (h HeadCommit) String() string { // PushEventRepository represents the repo object in a PushEvent payload. type PushEventRepository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Owner *User `json:"owner,omitempty"` - Private *bool `json:"private,omitempty"` - Description *string `json:"description,omitempty"` - Fork *bool `json:"fork,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Homepage *string `json:"homepage,omitempty"` - PullsURL *string `json:"pulls_url,omitempty"` - Size *int `json:"size,omitempty"` - StargazersCount *int `json:"stargazers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` - Language *string `json:"language,omitempty"` - HasIssues *bool `json:"has_issues,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` - HasWiki *bool `json:"has_wiki,omitempty"` - HasPages *bool `json:"has_pages,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - Organization *string `json:"organization,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveURL *string `json:"archive_url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]string `json:"custom_properties,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Owner *User `json:"owner,omitempty"` + Private *bool `json:"private,omitempty"` + Description *string `json:"description,omitempty"` + Fork *bool `json:"fork,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Homepage *string `json:"homepage,omitempty"` + PullsURL *string `json:"pulls_url,omitempty"` + Size *int `json:"size,omitempty"` + StargazersCount *int `json:"stargazers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` + Language *string `json:"language,omitempty"` + HasIssues *bool `json:"has_issues,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` + HasWiki *bool `json:"has_wiki,omitempty"` + HasPages *bool `json:"has_pages,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + Organization *string `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveURL *string `json:"archive_url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]interface{} `json:"custom_properties,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. @@ -1444,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 @@ -1504,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. // @@ -1684,6 +1787,7 @@ type WorkflowJobEvent struct { Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` Installation *Installation `json:"installation,omitempty"` + Deployment *Deployment `json:"deployment,omitempty"` } // WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed. @@ -1800,3 +1904,27 @@ type CodeScanningAlertEvent struct { Installation *Installation `json:"installation,omitempty"` } + +// SponsorshipEvent represents a sponsorship event in GitHub. +// +// GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent +type SponsorshipEvent struct { + Action *string `json:"action,omitempty"` + EffectiveDate *string `json:"effective_date,omitempty"` + Changes *SponsorshipChanges `json:"changes,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Sender *User `json:"sender,omitempty"` + Installation *Installation `json:"installation,omitempty"` +} + +// SponsorshipChanges represents changes made to the sponsorship. +type SponsorshipChanges struct { + Tier *SponsorshipTier `json:"tier,omitempty"` + PrivacyLevel *string `json:"privacy_level,omitempty"` +} + +// SponsorshipTier represents the tier information of a sponsorship. +type SponsorshipTier struct { + From *string `json:"from,omitempty"` +} diff --git a/vendor/github.com/google/go-github/v59/github/gists.go b/vendor/github.com/google/go-github/v67/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/gists.go rename to vendor/github.com/google/go-github/v67/github/gists.go diff --git a/vendor/github.com/google/go-github/v59/github/gists_comments.go b/vendor/github.com/google/go-github/v67/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/gists_comments.go rename to vendor/github.com/google/go-github/v67/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v59/github/git.go b/vendor/github.com/google/go-github/v67/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/git.go rename to vendor/github.com/google/go-github/v67/github/git.go diff --git a/vendor/github.com/google/go-github/v59/github/git_blobs.go b/vendor/github.com/google/go-github/v67/github/git_blobs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/git_blobs.go rename to vendor/github.com/google/go-github/v67/github/git_blobs.go diff --git a/vendor/github.com/google/go-github/v59/github/git_commits.go b/vendor/github.com/google/go-github/v67/github/git_commits.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/git_commits.go rename to vendor/github.com/google/go-github/v67/github/git_commits.go index 573d38b..fdb3d26 100644 --- a/vendor/github.com/google/go-github/v59/github/git_commits.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/git_refs.go b/vendor/github.com/google/go-github/v67/github/git_refs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/git_refs.go rename to vendor/github.com/google/go-github/v67/github/git_refs.go diff --git a/vendor/github.com/google/go-github/v59/github/git_tags.go b/vendor/github.com/google/go-github/v67/github/git_tags.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/git_tags.go rename to vendor/github.com/google/go-github/v67/github/git_tags.go diff --git a/vendor/github.com/google/go-github/v59/github/git_trees.go b/vendor/github.com/google/go-github/v67/github/git_trees.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/git_trees.go rename to vendor/github.com/google/go-github/v67/github/git_trees.go diff --git a/vendor/github.com/google/go-github/v59/github/github-accessors.go b/vendor/github.com/google/go-github/v67/github/github-accessors.go similarity index 92% rename from vendor/github.com/google/go-github/v59/github/github-accessors.go rename to vendor/github.com/google/go-github/v67/github/github-accessors.go index e28fd27..0782ba2 100644 --- a/vendor/github.com/google/go-github/v59/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v67/github/github-accessors.go @@ -662,6 +662,14 @@ func (a *AnalysesListOptions) GetSarifID() string { return *a.SarifID } +// GetDomains returns the Domains field. +func (a *APIMeta) GetDomains() *APIMetaDomains { + if a == nil { + return nil + } + return a.Domains +} + // GetSSHKeyFingerprints returns the SSHKeyFingerprints map if it's non-nil, an empty map otherwise. func (a *APIMeta) GetSSHKeyFingerprints() map[string]string { if a == nil || a.SSHKeyFingerprints == nil { @@ -678,6 +686,14 @@ func (a *APIMeta) GetVerifiablePasswordAuthentication() bool { return *a.VerifiablePasswordAuthentication } +// GetArtifactAttestations returns the ArtifactAttestations field. +func (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations { + if a == nil { + return nil + } + return a.ArtifactAttestations +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (a *App) GetCreatedAt() Timestamp { if a == nil || a.CreatedAt == nil { @@ -1574,6 +1590,14 @@ func (b *Branch) GetProtected() bool { return *b.Protected } +// GetProtection returns the Protection field. +func (b *Branch) GetProtection() *Protection { + if b == nil { + return nil + } + return b.Protection +} + // GetCommit returns the Commit field. func (b *BranchCommit) GetCommit() *Commit { if b == nil { @@ -1622,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 { @@ -2262,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 { @@ -2278,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 { @@ -2614,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 { @@ -4014,6 +4294,102 @@ func (c *ContributorStats) GetTotal() int { return *c.Total } +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise. +func (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string { + if c == nil || c.CustomModelTrainingDate == nil { + return "" + } + return *c.CustomModelTrainingDate +} + +// GetCopilotDotcomChat returns the CopilotDotcomChat field. +func (c *CopilotMetrics) GetCopilotDotcomChat() *CopilotDotcomChat { + if c == nil { + return nil + } + return c.CopilotDotcomChat +} + +// GetCopilotDotcomPullRequests returns the CopilotDotcomPullRequests field. +func (c *CopilotMetrics) GetCopilotDotcomPullRequests() *CopilotDotcomPullRequests { + if c == nil { + return nil + } + return c.CopilotDotcomPullRequests +} + +// GetCopilotIDEChat returns the CopilotIDEChat field. +func (c *CopilotMetrics) GetCopilotIDEChat() *CopilotIDEChat { + if c == nil { + return nil + } + return c.CopilotIDEChat +} + +// GetCopilotIDECodeCompletions returns the CopilotIDECodeCompletions field. +func (c *CopilotMetrics) GetCopilotIDECodeCompletions() *CopilotIDECodeCompletions { + if c == nil { + return nil + } + return c.CopilotIDECodeCompletions +} + +// GetTotalActiveUsers returns the TotalActiveUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetrics) GetTotalActiveUsers() int { + if c == nil || c.TotalActiveUsers == nil { + return 0 + } + return *c.TotalActiveUsers +} + +// GetTotalEngagedUsers returns the TotalEngagedUsers field if it's non-nil, zero value otherwise. +func (c *CopilotMetrics) GetTotalEngagedUsers() int { + if c == nil || c.TotalEngagedUsers == nil { + return 0 + } + return *c.TotalEngagedUsers +} + +// GetSince returns the Since field if it's non-nil, zero value otherwise. +func (c *CopilotMetricsListOptions) 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 *CopilotMetricsListOptions) GetUntil() time.Time { + if c == nil || c.Until == nil { + return time.Time{} + } + return *c.Until +} + // GetSeatBreakdown returns the SeatBreakdown field. func (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown { if c == nil { @@ -4062,6 +4438,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 { @@ -4343,7 +4727,7 @@ func (c *CreateOrgInvitationOptions) GetRole() string { } // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRoleOptions) GetBaseRole() string { +func (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string { if c == nil || c.BaseRole == nil { return "" } @@ -4351,7 +4735,7 @@ func (c *CreateOrUpdateCustomRoleOptions) GetBaseRole() string { } // GetDescription returns the Description field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRoleOptions) GetDescription() string { +func (c *CreateOrUpdateCustomRepoRoleOptions) GetDescription() string { if c == nil || c.Description == nil { return "" } @@ -4359,26 +4743,50 @@ func (c *CreateOrUpdateCustomRoleOptions) GetDescription() string { } // GetName returns the Name field if it's non-nil, zero value otherwise. -func (c *CreateOrUpdateCustomRoleOptions) GetName() string { +func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { if c == nil || c.Name == nil { return "" } return *c.Name } -// GetFrom returns the From field if it's non-nil, zero value otherwise. -func (c *CreateProtectedChanges) GetFrom() bool { - if c == nil || c.From == nil { - return false +// 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.From + return *c.BaseRole } -// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. -func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool { - if c == nil || c.AllowsPublicRepositories == nil { - return false - } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateOrgRoleOptions) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (c *CreateProtectedChanges) GetFrom() bool { + if c == nil || c.From == nil { + return false + } + return *c.From +} + +// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. +func (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool { + if c == nil || c.AllowsPublicRepositories == nil { + return false + } return *c.AllowsPublicRepositories } @@ -4678,6 +5086,70 @@ func (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 { return *c.IntegrationID } +// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetBaseRole() string { + if c == nil || c.BaseRole == nil { + return "" + } + return *c.BaseRole +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) 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 *CustomOrgRoles) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetOrg returns the Org field. +func (c *CustomOrgRoles) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetSource() string { + if c == nil || c.Source == nil { + return "" + } + return *c.Source +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CustomOrgRoles) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetDefaultValue returns the DefaultValue field if it's non-nil, zero value otherwise. func (c *CustomProperty) GetDefaultValue() string { if c == nil || c.DefaultValue == nil { @@ -4710,12 +5182,12 @@ func (c *CustomProperty) GetRequired() bool { return *c.Required } -// GetValue returns the Value field if it's non-nil, zero value otherwise. -func (c *CustomPropertyValue) GetValue() string { - if c == nil || c.Value == nil { +// GetValuesEditableBy returns the ValuesEditableBy field if it's non-nil, zero value otherwise. +func (c *CustomProperty) GetValuesEditableBy() string { + if c == nil || c.ValuesEditableBy == nil { return "" } - return *c.Value + return *c.ValuesEditableBy } // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. @@ -4726,6 +5198,14 @@ func (c *CustomRepoRoles) GetBaseRole() string { return *c.BaseRole } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetCreatedAt() Timestamp { + if c == nil || c.CreatedAt == nil { + return Timestamp{} + } + return *c.CreatedAt +} + // GetDescription returns the Description field if it's non-nil, zero value otherwise. func (c *CustomRepoRoles) GetDescription() string { if c == nil || c.Description == nil { @@ -4750,6 +5230,22 @@ func (c *CustomRepoRoles) GetName() string { return *c.Name } +// GetOrg returns the Org field. +func (c *CustomRepoRoles) GetOrg() *Organization { + if c == nil { + return nil + } + return c.Org +} + +// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. +func (c *CustomRepoRoles) GetUpdatedAt() Timestamp { + if c == nil || c.UpdatedAt == nil { + return Timestamp{} + } + return *c.UpdatedAt +} + // GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise. func (d *DefaultSetupConfiguration) GetQuerySuite() string { if d == nil || d.QuerySuite == nil { @@ -5198,6 +5694,174 @@ 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 { + return nil + } + return d.Detector +} + +// GetJob returns the Job field. +func (d *DependencyGraphSnapshot) GetJob() *DependencyGraphSnapshotJob { + if d == nil { + return nil + } + return d.Job +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetRef() string { + if d == nil || d.Ref == nil { + return "" + } + return *d.Ref +} + +// GetScanned returns the Scanned field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetScanned() Timestamp { + if d == nil || d.Scanned == nil { + return Timestamp{} + } + return *d.Scanned +} + +// GetSha returns the Sha field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshot) GetSha() string { + if d == nil || d.Sha == nil { + return "" + } + return *d.Sha +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp { + if d == nil || d.CreatedAt == nil { + return Timestamp{} + } + return *d.CreatedAt +} + +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetMessage() string { + if d == nil || d.Message == nil { + return "" + } + return *d.Message +} + +// GetResult returns the Result field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotCreationData) GetResult() string { + if d == nil || d.Result == nil { + return "" + } + return *d.Result +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetURL() string { + if d == nil || d.URL == nil { + return "" + } + return *d.URL +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotDetector) GetVersion() string { + if d == nil || d.Version == nil { + return "" + } + return *d.Version +} + +// GetCorrelator returns the Correlator field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetCorrelator() string { + if d == nil || d.Correlator == nil { + return "" + } + return *d.Correlator +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetHTMLURL() string { + if d == nil || d.HTMLURL == nil { + return "" + } + return *d.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotJob) GetID() string { + if d == nil || d.ID == nil { + return "" + } + return *d.ID +} + +// GetFile returns the File field. +func (d *DependencyGraphSnapshotManifest) GetFile() *DependencyGraphSnapshotManifestFile { + if d == nil { + return nil + } + return d.File +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotManifest) GetName() string { + if d == nil || d.Name == nil { + return "" + } + return *d.Name +} + +// GetSourceLocation returns the SourceLocation field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { + if d == nil || d.SourceLocation == nil { + return "" + } + return *d.SourceLocation +} + +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string { + if d == nil || d.PackageURL == nil { + return "" + } + return *d.PackageURL +} + +// GetRelationship returns the Relationship field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetRelationship() string { + if d == nil || d.Relationship == nil { + return "" + } + return *d.Relationship +} + +// GetScope returns the Scope field if it's non-nil, zero value otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetScope() string { + if d == nil || d.Scope == nil { + return "" + } + return *d.Scope +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (d *DeployKeyEvent) GetAction() string { if d == nil || d.Action == nil { @@ -5598,58 +6262,162 @@ 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.Organization +} + +// GetRepo returns the Repo field. +func (d *DeploymentReviewEvent) GetRepo() *Repository { + if d == nil { + return nil + } + return d.Repo +} + +// GetRequester returns the Requester field. +func (d *DeploymentReviewEvent) GetRequester() *User { + if d == nil { + return nil + } + return d.Requester +} + +// 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 } @@ -5710,6 +6478,14 @@ func (d *DeploymentStatus) GetURL() string { return *d.URL } +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (d *DeploymentStatusEvent) GetAction() string { + if d == nil || d.Action == nil { + return "" + } + return *d.Action +} + // GetDeployment returns the Deployment field. func (d *DeploymentStatusEvent) GetDeployment() *Deployment { if d == nil { @@ -7894,6 +8670,14 @@ func (h *Hook) GetActive() bool { return *h.Active } +// GetConfig returns the Config field. +func (h *Hook) GetConfig() *HookConfig { + if h == nil { + return nil + } + return h.Config +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (h *Hook) GetCreatedAt() Timestamp { if h == nil || h.CreatedAt == nil { @@ -8566,6 +9350,14 @@ func (i *InstallationPermissions) GetActions() string { return *i.Actions } +// GetActionsVariables returns the ActionsVariables field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetActionsVariables() string { + if i == nil || i.ActionsVariables == nil { + return "" + } + return *i.ActionsVariables +} + // GetAdministration returns the Administration field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetAdministration() string { if i == nil || i.Administration == nil { @@ -8590,6 +9382,38 @@ func (i *InstallationPermissions) GetChecks() string { return *i.Checks } +// GetCodespaces returns the Codespaces field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespaces() string { + if i == nil || i.Codespaces == nil { + return "" + } + return *i.Codespaces +} + +// GetCodespacesLifecycleAdmin returns the CodespacesLifecycleAdmin field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesLifecycleAdmin() string { + if i == nil || i.CodespacesLifecycleAdmin == nil { + return "" + } + return *i.CodespacesLifecycleAdmin +} + +// GetCodespacesMetadata returns the CodespacesMetadata field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesMetadata() string { + if i == nil || i.CodespacesMetadata == nil { + return "" + } + return *i.CodespacesMetadata +} + +// GetCodespacesSecrets returns the CodespacesSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetCodespacesSecrets() string { + if i == nil || i.CodespacesSecrets == nil { + return "" + } + return *i.CodespacesSecrets +} + // GetContentReferences returns the ContentReferences field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetContentReferences() string { if i == nil || i.ContentReferences == nil { @@ -8606,6 +9430,14 @@ func (i *InstallationPermissions) GetContents() string { return *i.Contents } +// GetDependabotSecrets returns the DependabotSecrets field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetDependabotSecrets() string { + if i == nil || i.DependabotSecrets == nil { + return "" + } + return *i.DependabotSecrets +} + // GetDeployments returns the Deployments field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetDeployments() string { if i == nil || i.Deployments == nil { @@ -8614,6 +9446,14 @@ func (i *InstallationPermissions) GetDeployments() string { return *i.Deployments } +// GetDiscussions returns the Discussions field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetDiscussions() string { + if i == nil || i.Discussions == nil { + return "" + } + return *i.Discussions +} + // GetEmails returns the Emails field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetEmails() string { if i == nil || i.Emails == nil { @@ -8654,6 +9494,14 @@ func (i *InstallationPermissions) GetMembers() string { return *i.Members } +// GetMergeQueues returns the MergeQueues field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetMergeQueues() string { + if i == nil || i.MergeQueues == nil { + return "" + } + return *i.MergeQueues +} + // GetMetadata returns the Metadata field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetMetadata() string { if i == nil || i.Metadata == nil { @@ -8670,6 +9518,22 @@ func (i *InstallationPermissions) GetOrganizationAdministration() string { return *i.OrganizationAdministration } +// GetOrganizationCustomOrgRoles returns the OrganizationCustomOrgRoles field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCustomOrgRoles() string { + if i == nil || i.OrganizationCustomOrgRoles == nil { + return "" + } + return *i.OrganizationCustomOrgRoles +} + +// GetOrganizationCustomProperties returns the OrganizationCustomProperties field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationCustomProperties() string { + if i == nil || i.OrganizationCustomProperties == nil { + return "" + } + return *i.OrganizationCustomProperties +} + // GetOrganizationCustomRoles returns the OrganizationCustomRoles field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationCustomRoles() string { if i == nil || i.OrganizationCustomRoles == nil { @@ -8694,6 +9558,22 @@ func (i *InstallationPermissions) GetOrganizationPackages() string { return *i.OrganizationPackages } +// GetOrganizationPersonalAccessTokenRequests returns the OrganizationPersonalAccessTokenRequests field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationPersonalAccessTokenRequests() string { + if i == nil || i.OrganizationPersonalAccessTokenRequests == nil { + return "" + } + return *i.OrganizationPersonalAccessTokenRequests +} + +// GetOrganizationPersonalAccessTokens returns the OrganizationPersonalAccessTokens field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetOrganizationPersonalAccessTokens() string { + if i == nil || i.OrganizationPersonalAccessTokens == nil { + return "" + } + return *i.OrganizationPersonalAccessTokens +} + // GetOrganizationPlan returns the OrganizationPlan field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetOrganizationPlan() string { if i == nil || i.OrganizationPlan == nil { @@ -8766,6 +9646,22 @@ func (i *InstallationPermissions) GetPullRequests() string { return *i.PullRequests } +// GetRepositoryAdvisories returns the RepositoryAdvisories field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetRepositoryAdvisories() string { + if i == nil || i.RepositoryAdvisories == nil { + return "" + } + return *i.RepositoryAdvisories +} + +// GetRepositoryCustomProperties returns the RepositoryCustomProperties field if it's non-nil, zero value otherwise. +func (i *InstallationPermissions) GetRepositoryCustomProperties() string { + if i == nil || i.RepositoryCustomProperties == nil { + return "" + } + return *i.RepositoryCustomProperties +} + // GetRepositoryHooks returns the RepositoryHooks field if it's non-nil, zero value otherwise. func (i *InstallationPermissions) GetRepositoryHooks() string { if i == nil || i.RepositoryHooks == nil { @@ -9038,6 +9934,14 @@ func (i *InstallationToken) GetToken() string { return *i.Token } +// GetPermissions returns the Permissions field. +func (i *InstallationTokenListRepoOptions) GetPermissions() *InstallationPermissions { + if i == nil { + return nil + } + return i.Permissions +} + // GetPermissions returns the Permissions field. func (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions { if i == nil { @@ -10534,6 +11438,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 { @@ -10734,6 +11646,14 @@ func (l *ListRepositories) GetTotalCount() int { return *l.TotalCount } +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (l *ListRunnersOptions) GetName() string { + if l == nil || l.Name == nil { + return "" + } + return *l.Name +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (l *ListSCIMProvisionedIdentitiesOptions) GetCount() int { if l == nil || l.Count == nil { @@ -11182,6 +12102,54 @@ func (m *Match) GetText() string { return *m.Text } +// GetPermission returns the Permission field. +func (m *MemberChanges) GetPermission() *MemberChangesPermission { + if m == nil { + return nil + } + return m.Permission +} + +// GetRoleName returns the RoleName field. +func (m *MemberChanges) GetRoleName() *MemberChangesRoleName { + if m == nil { + return nil + } + return m.RoleName +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (m *MemberChangesPermission) GetFrom() string { + if m == nil || m.From == nil { + return "" + } + return *m.From +} + +// GetTo returns the To field if it's non-nil, zero value otherwise. +func (m *MemberChangesPermission) GetTo() string { + if m == nil || m.To == nil { + return "" + } + return *m.To +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (m *MemberChangesRoleName) GetFrom() string { + if m == nil || m.From == nil { + return "" + } + return *m.From +} + +// GetTo returns the To field if it's non-nil, zero value otherwise. +func (m *MemberChangesRoleName) GetTo() string { + if m == nil || m.To == nil { + return "" + } + return *m.To +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (m *MemberEvent) GetAction() string { if m == nil || m.Action == nil { @@ -11190,6 +12158,14 @@ func (m *MemberEvent) GetAction() string { return *m.Action } +// GetChanges returns the Changes field. +func (m *MemberEvent) GetChanges() *MemberChanges { + if m == nil { + return nil + } + return m.Changes +} + // GetInstallation returns the Installation field. func (m *MemberEvent) GetInstallation() *Installation { if m == nil { @@ -11958,6 +12934,14 @@ func (n *NewTeam) GetLDAPDN() string { return *n.LDAPDN } +// GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise. +func (n *NewTeam) GetNotificationSetting() string { + if n == nil || n.NotificationSetting == nil { + return "" + } + return *n.NotificationSetting +} + // GetParentTeamID returns the ParentTeamID field if it's non-nil, zero value otherwise. func (n *NewTeam) GetParentTeamID() int64 { if n == nil || n.ParentTeamID == nil { @@ -12566,6 +13550,14 @@ func (o *OrganizationCustomRepoRoles) GetTotalCount() int { return *o.TotalCount } +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (o *OrganizationCustomRoles) GetTotalCount() int { + if o == nil || o.TotalCount == nil { + return 0 + } + return *o.TotalCount +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (o *OrganizationEvent) GetAction() string { if o == nil || o.Action == nil { @@ -13958,31 +14950,175 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } -// GetOrg returns the Org map if it's non-nil, an empty map otherwise. -func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { - if p == nil || p.Org == nil { - return map[string]string{} +// 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.Org + return *p.CurrentUserCanApprove } -// GetOther returns the Other map if it's non-nil, an empty map otherwise. -func (p *PersonalAccessTokenPermissions) GetOther() map[string]string { - if p == nil || p.Other == nil { - return map[string]string{} +// GetEnvironment returns the Environment field. +func (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment { + if p == nil { + return nil } - return p.Other + return p.Environment } -// GetRepo returns the Repo map if it's non-nil, an empty map otherwise. -func (p *PersonalAccessTokenPermissions) GetRepo() map[string]string { - if p == nil || p.Repo == nil { - return map[string]string{} +// 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.Repo + return *p.WaitTimer } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +// 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 { + return Timestamp{} + } + return *p.AccessGrantedAt +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetID() int64 { + if p == nil || p.ID == nil { + return 0 + } + return *p.ID +} + +// GetOwner returns the Owner field. +func (p *PersonalAccessToken) GetOwner() *User { + if p == nil { + return nil + } + return p.Owner +} + +// GetPermissions returns the Permissions field. +func (p *PersonalAccessToken) GetPermissions() *PersonalAccessTokenPermissions { + if p == nil { + return nil + } + return p.Permissions +} + +// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetRepositoriesURL() string { + if p == nil || p.RepositoriesURL == nil { + return "" + } + return *p.RepositoriesURL +} + +// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetRepositorySelection() string { + if p == nil || p.RepositorySelection == nil { + return "" + } + return *p.RepositorySelection +} + +// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenExpired() bool { + if p == nil || p.TokenExpired == nil { + return false + } + return *p.TokenExpired +} + +// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenExpiresAt() Timestamp { + if p == nil || p.TokenExpiresAt == nil { + return Timestamp{} + } + return *p.TokenExpiresAt +} + +// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise. +func (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp { + if p == nil || p.TokenLastUsedAt == nil { + return Timestamp{} + } + return *p.TokenLastUsedAt +} + +// GetOrg returns the Org map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOrg() map[string]string { + if p == nil || p.Org == nil { + return map[string]string{} + } + return p.Org +} + +// GetOther returns the Other map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetOther() map[string]string { + if p == nil || p.Other == nil { + return map[string]string{} + } + return p.Other +} + +// GetRepo returns the Repo map if it's non-nil, an empty map otherwise. +func (p *PersonalAccessTokenPermissions) GetRepo() map[string]string { + if p == nil || p.Repo == nil { + return map[string]string{} + } + return p.Repo +} + +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *PersonalAccessTokenRequest) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { return Timestamp{} @@ -17254,14 +18390,6 @@ func (p *PushEventRepository) GetCreatedAt() Timestamp { return *p.CreatedAt } -// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. -func (p *PushEventRepository) GetCustomProperties() map[string]string { - if p == nil || p.CustomProperties == nil { - return map[string]string{} - } - return p.CustomProperties -} - // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (p *PushEventRepository) GetDefaultBranch() string { if p == nil || p.DefaultBranch == nil { @@ -17526,6 +18654,14 @@ func (r *RateLimits) GetActionsRunnerRegistration() *Rate { return r.ActionsRunnerRegistration } +// GetAuditLog returns the AuditLog field. +func (r *RateLimits) GetAuditLog() *Rate { + if r == nil { + return nil + } + return r.AuditLog +} + // GetCodeScanningUpload returns the CodeScanningUpload field. func (r *RateLimits) GetCodeScanningUpload() *Rate { if r == nil { @@ -18398,14 +19534,6 @@ func (r *Repository) GetCreatedAt() Timestamp { return *r.CreatedAt } -// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise. -func (r *Repository) GetCustomProperties() map[string]string { - if r == nil || r.CustomProperties == nil { - return map[string]string{} - } - return r.CustomProperties -} - // GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise. func (r *Repository) GetDefaultBranch() string { if r == nil || r.DefaultBranch == nil { @@ -19086,6 +20214,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 { @@ -19534,6 +20678,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 { @@ -19718,6 +20870,14 @@ func (r *RepositoryPermissionLevel) GetPermission() string { return *r.Permission } +// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise. +func (r *RepositoryPermissionLevel) GetRoleName() string { + if r == nil || r.RoleName == nil { + return "" + } + return *r.RoleName +} + // GetUser returns the User field. func (r *RepositoryPermissionLevel) GetUser() *User { if r == nil { @@ -19859,39 +21019,575 @@ func (r *RepositoryRelease) GetTargetCommitish() string { if r == nil || r.TargetCommitish == nil { return "" } - return *r.TargetCommitish + 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 +} + +// GetMergeQueue returns the MergeQueue field. +func (r *RepositoryRulesetRule) GetMergeQueue() *RepositoryRulesetMergeQueueRule { + if r == nil { + return nil + } + return r.MergeQueue +} + +// GetNonFastForward returns the NonFastForward field. +func (r *RepositoryRulesetRule) GetNonFastForward() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.NonFastForward +} + +// GetPullRequest returns the PullRequest field. +func (r *RepositoryRulesetRule) GetPullRequest() *RepositoryRulesetPullRequestRule { + if r == nil { + return nil + } + return r.PullRequest +} + +// GetRequiredDeployments returns the RequiredDeployments field. +func (r *RepositoryRulesetRule) GetRequiredDeployments() *RepositoryRulesetRequiredDeploymentsRule { + if r == nil { + return nil + } + return r.RequiredDeployments +} + +// GetRequiredLinearHistory returns the RequiredLinearHistory field. +func (r *RepositoryRulesetRule) GetRequiredLinearHistory() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.RequiredLinearHistory +} + +// GetRequiredSignatures returns the RequiredSignatures field. +func (r *RepositoryRulesetRule) GetRequiredSignatures() *RepositoryRulesetRuleType { + if r == nil { + return nil + } + return r.RequiredSignatures +} + +// GetRequiredStatusChecks returns the RequiredStatusChecks field. +func (r *RepositoryRulesetRule) GetRequiredStatusChecks() *RepositoryRulesetRequiredStatusChecksRule { + if r == nil { + return nil + } + return r.RequiredStatusChecks +} + +// GetTagNamePattern returns the TagNamePattern field. +func (r *RepositoryRulesetRule) GetTagNamePattern() *RepositoryRulesetPatternRule { + if r == nil { + return nil + } + return r.TagNamePattern +} + +// GetUpdate returns the Update field. +func (r *RepositoryRulesetRule) GetUpdate() *RepositoryRulesetUpdateRule { + if r == nil { + return nil + } + return r.Update +} + +// GetWorkflows returns the Workflows field. +func (r *RepositoryRulesetRule) GetWorkflows() *RepositoryRulesetWorkflowsRule { + if r == nil { + return nil + } + return r.Workflows +} + +// GetConditionType returns the ConditionType field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetConditionType() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.ConditionType +} + +// GetExclude returns the Exclude field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetExclude() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Exclude +} + +// GetInclude returns the Include field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetInclude() *RepositoryRulesetEditedSources { + if r == nil { + return nil + } + return r.Include +} + +// GetTarget returns the Target field. +func (r *RepositoryRulesetUpdatedConditionsEdited) GetTarget() *RepositoryRulesetEditedSource { + if r == nil { + return nil + } + return r.Target } -// 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 "" +// GetChanges returns the Changes field. +func (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetEditedRuleChanges { + if r == nil { + return nil } - return *r.UploadURL + return r.Changes } -// 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 "" +// GetRule returns the Rule field. +func (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRulesetRule { + if r == nil { + return nil } - return *r.URL + return r.Rule } -// 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 "" +// GetParameters returns the Parameters field. +func (r *RepositoryRulesetUpdateRule) GetParameters() *UpdateAllowsFetchAndMergeRuleParameters { + if r == nil { + return nil } - return *r.ZipballURL + return r.Parameters } -// 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 *RepositoryRulesetWorkflowsRule) GetParameters() *RequiredWorkflowsRuleParameters { + if r == nil { + return nil } - return *r.Parameters + return r.Parameters } // GetCommit returns the Commit field. @@ -20246,6 +21942,22 @@ func (r *RequiredStatusCheck) GetAppID() int64 { return *r.AppID } +// GetChecks returns the Checks field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecks) GetChecks() []*RequiredStatusCheck { + if r == nil || r.Checks == nil { + return nil + } + return *r.Checks +} + +// GetContexts returns the Contexts field if it's non-nil, zero value otherwise. +func (r *RequiredStatusChecks) GetContexts() []string { + if r == nil || r.Contexts == nil { + return nil + } + return *r.Contexts +} + // GetContextsURL returns the ContextsURL field if it's non-nil, zero value otherwise. func (r *RequiredStatusChecks) GetContextsURL() string { if r == nil || r.ContextsURL == nil { @@ -20278,6 +21990,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 { @@ -20358,6 +22078,14 @@ func (r *Rule) GetSeverity() string { return *r.Severity } +// GetRestrictedFilePaths returns the RestrictedFilePaths field if it's non-nil, zero value otherwise. +func (r *RuleFileParameters) GetRestrictedFilePaths() []string { + if r == nil || r.RestrictedFilePaths == nil { + return nil + } + return *r.RestrictedFilePaths +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (r *RulePatternParameters) GetName() string { if r == nil || r.Name == nil { @@ -20414,6 +22142,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 { @@ -20454,6 +22190,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 { @@ -20478,6 +22222,14 @@ func (r *RulesetConditions) GetRepositoryName() *RulesetRepositoryNamesCondition return r.RepositoryName } +// GetRepositoryProperty returns the RepositoryProperty field. +func (r *RulesetConditions) GetRepositoryProperty() *RulesetRepositoryPropertyConditionParameters { + if r == nil { + return nil + } + return r.RepositoryProperty +} + // GetHRef returns the HRef field if it's non-nil, zero value otherwise. func (r *RulesetLink) GetHRef() string { if r == nil || r.HRef == nil { @@ -20502,6 +22254,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 { @@ -21350,6 +23110,14 @@ func (s *SecretScanningAlertLocationDetails) GetPath() string { return *s.Path } +// GetPullRequestCommentURL returns the PullRequestCommentURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlertLocationDetails) GetPullRequestCommentURL() string { + if s == nil || s.PullRequestCommentURL == nil { + return "" + } + return *s.PullRequestCommentURL +} + // GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertLocationDetails) GetStartColumn() int { if s == nil || s.StartColumn == nil { @@ -21366,6 +23134,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 { @@ -21862,6 +23686,86 @@ func (s *SourceImportAuthor) GetURL() string { return *s.URL } +// GetPrivacyLevel returns the PrivacyLevel field if it's non-nil, zero value otherwise. +func (s *SponsorshipChanges) GetPrivacyLevel() string { + if s == nil || s.PrivacyLevel == nil { + return "" + } + return *s.PrivacyLevel +} + +// GetTier returns the Tier field. +func (s *SponsorshipChanges) GetTier() *SponsorshipTier { + if s == nil { + return nil + } + return s.Tier +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (s *SponsorshipEvent) GetAction() string { + if s == nil || s.Action == nil { + return "" + } + return *s.Action +} + +// GetChanges returns the Changes field. +func (s *SponsorshipEvent) GetChanges() *SponsorshipChanges { + if s == nil { + return nil + } + return s.Changes +} + +// GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise. +func (s *SponsorshipEvent) GetEffectiveDate() string { + if s == nil || s.EffectiveDate == nil { + return "" + } + return *s.EffectiveDate +} + +// GetInstallation returns the Installation field. +func (s *SponsorshipEvent) GetInstallation() *Installation { + if s == nil { + return nil + } + return s.Installation +} + +// GetOrganization returns the Organization field. +func (s *SponsorshipEvent) GetOrganization() *Organization { + if s == nil { + return nil + } + return s.Organization +} + +// GetRepository returns the Repository field. +func (s *SponsorshipEvent) GetRepository() *Repository { + if s == nil { + return nil + } + return s.Repository +} + +// GetSender returns the Sender field. +func (s *SponsorshipEvent) GetSender() *User { + if s == nil { + return nil + } + return s.Sender +} + +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (s *SponsorshipTier) GetFrom() string { + if s == nil || s.From == nil { + return "" + } + return *s.From +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *SSHSigningKey) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -24750,6 +26654,14 @@ func (w *WorkflowJobEvent) GetAction() string { return *w.Action } +// GetDeployment returns the Deployment field. +func (w *WorkflowJobEvent) GetDeployment() *Deployment { + if w == nil { + return nil + } + return w.Deployment +} + // GetInstallation returns the Installation field. func (w *WorkflowJobEvent) GetInstallation() *Installation { if w == nil { @@ -24790,6 +26702,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 { @@ -24950,6 +26926,14 @@ func (w *WorkflowRun) GetNodeID() string { return *w.NodeID } +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (w *WorkflowRun) GetPath() string { + if w == nil || w.Path == nil { + return "" + } + return *w.Path +} + // GetPreviousAttemptURL returns the PreviousAttemptURL field if it's non-nil, zero value otherwise. func (w *WorkflowRun) GetPreviousAttemptURL() string { if w == nil || w.PreviousAttemptURL == nil { diff --git a/vendor/github.com/google/go-github/v59/github/github.go b/vendor/github.com/google/go-github/v67/github/github.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/github.go rename to vendor/github.com/google/go-github/v67/github/github.go index 805a3fe..6f47635 100644 --- a/vendor/github.com/google/go-github/v59/github/github.go +++ b/vendor/github.com/google/go-github/v67/github/github.go @@ -28,7 +28,7 @@ import ( ) const ( - Version = "v59.0.0" + Version = "v67.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" @@ -170,7 +170,7 @@ type Client struct { UserAgent string rateMu sync.Mutex - rateLimits [categories]Rate // Rate limits for the client as determined by the most recent API calls. + rateLimits [Categories]Rate // Rate limits for the client as determined by the most recent API calls. secondaryRateLimitReset time.Time // Secondary rate limit reset for the client as determined by the most recent API calls. common service // Reuse a single struct instead of allocating one for each service on the heap. @@ -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)) @@ -804,6 +804,7 @@ type requestContext uint8 const ( bypassRateLimitCheck requestContext = iota + SleepUntilPrimaryRateLimitResetWhenRateLimited ) // BareDo sends an API request and lets you handle the api response. If an error @@ -821,7 +822,7 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro req = withContext(ctx, req) - rateLimitCategory := category(req.Method, req.URL.Path) + rateLimitCategory := GetRateLimitCategory(req.Method, req.URL.Path) if bypass := ctx.Value(bypassRateLimitCheck); bypass == nil { // If we've hit rate limit, don't make further requests before Reset time. @@ -889,6 +890,15 @@ func (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, erro err = aerr } + rateLimitError, ok := err.(*RateLimitError) + if ok && req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { + if err := sleepUntilResetWithBuffer(req.Context(), rateLimitError.Rate.Reset.Time); err != nil { + return response, err + } + // retry the request once when the rate limit has reset + return c.BareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), req) + } + // Update the secondary rate limit if we hit it. rerr, ok := err.(*AbuseRateLimitError) if ok && rerr.RetryAfter != nil { @@ -937,7 +947,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Res // current client state in order to quickly check if *RateLimitError can be immediately returned // from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily. // Otherwise it returns nil, and Client.Do should proceed normally. -func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rateLimitCategory) *RateLimitError { +func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory RateLimitCategory) *RateLimitError { c.rateMu.Lock() rate := c.rateLimits[rateLimitCategory] c.rateMu.Unlock() @@ -950,6 +960,18 @@ func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rat Header: make(http.Header), Body: io.NopCloser(strings.NewReader("")), } + + if req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil { + if err := sleepUntilResetWithBuffer(req.Context(), rate.Reset.Time); err == nil { + return nil + } + return &RateLimitError{ + Rate: rate, + Response: resp, + Message: fmt.Sprintf("Context cancelled while waiting for rate limit to reset until %v, not making remote request.", rate.Reset.Time), + } + } + return &RateLimitError{ Rate: rate, Response: resp, @@ -1303,65 +1325,70 @@ func parseBoolResponse(err error) (bool, error) { return false, err } -type rateLimitCategory uint8 +type RateLimitCategory uint8 const ( - coreCategory rateLimitCategory = iota - searchCategory - graphqlCategory - integrationManifestCategory - sourceImportCategory - codeScanningUploadCategory - actionsRunnerRegistrationCategory - scimCategory - dependencySnapshotsCategory - codeSearchCategory - - categories // An array of this length will be able to contain all rate limit categories. + CoreCategory RateLimitCategory = iota + SearchCategory + GraphqlCategory + IntegrationManifestCategory + SourceImportCategory + CodeScanningUploadCategory + ActionsRunnerRegistrationCategory + ScimCategory + DependencySnapshotsCategory + CodeSearchCategory + AuditLogCategory + + Categories // An array of this length will be able to contain all rate limit categories. ) -// category returns the rate limit category of the endpoint, determined by HTTP method and Request.URL.Path. -func category(method, path string) rateLimitCategory { +// GetRateLimitCategory returns the rate limit RateLimitCategory of the endpoint, determined by HTTP method and Request.URL.Path. +func GetRateLimitCategory(method, path string) RateLimitCategory { switch { // https://docs.github.com/rest/rate-limit#about-rate-limits default: // NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too, // because no API found for this category. - return coreCategory + return CoreCategory // https://docs.github.com/en/rest/search/search#search-code case strings.HasPrefix(path, "/search/code") && method == http.MethodGet: - return codeSearchCategory + return CodeSearchCategory case strings.HasPrefix(path, "/search/"): - return searchCategory + return SearchCategory case path == "/graphql": - return graphqlCategory + return GraphqlCategory case strings.HasPrefix(path, "/app-manifests/") && strings.HasSuffix(path, "/conversions") && method == http.MethodPost: - return integrationManifestCategory + return IntegrationManifestCategory // https://docs.github.com/rest/migrations/source-imports#start-an-import case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/import") && method == http.MethodPut: - return sourceImportCategory + return SourceImportCategory // https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data case strings.HasSuffix(path, "/code-scanning/sarifs"): - return codeScanningUploadCategory + return CodeScanningUploadCategory // https://docs.github.com/enterprise-cloud@latest/rest/scim case strings.HasPrefix(path, "/scim/"): - return scimCategory + return ScimCategory // https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository case strings.HasPrefix(path, "/repos/") && strings.HasSuffix(path, "/dependency-graph/snapshots") && method == http.MethodPost: - return dependencySnapshotsCategory + return DependencySnapshotsCategory + + // https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization + case strings.HasSuffix(path, "/audit-log"): + return AuditLogCategory } } @@ -1509,6 +1536,20 @@ func formatRateReset(d time.Duration) string { return fmt.Sprintf("[rate reset in %v]", timeString) } +func sleepUntilResetWithBuffer(ctx context.Context, reset time.Time) error { + buffer := time.Second + timer := time.NewTimer(time.Until(reset) + buffer) + select { + case <-ctx.Done(): + if !timer.Stop() { + <-timer.C + } + return ctx.Err() + case <-timer.C: + } + return nil +} + // When using roundTripWithOptionalFollowRedirect, note that it // is the responsibility of the caller to close the response body. func (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, maxRedirects int, opts ...RequestOption) (*http.Response, error) { @@ -1554,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/v59/github/gitignore.go b/vendor/github.com/google/go-github/v67/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/gitignore.go rename to vendor/github.com/google/go-github/v67/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v59/github/interactions.go b/vendor/github.com/google/go-github/v67/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/interactions.go rename to vendor/github.com/google/go-github/v67/github/interactions.go diff --git a/vendor/github.com/google/go-github/v59/github/interactions_orgs.go b/vendor/github.com/google/go-github/v67/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v67/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v59/github/interactions_repos.go b/vendor/github.com/google/go-github/v67/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/interactions_repos.go rename to vendor/github.com/google/go-github/v67/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v59/github/issue_import.go b/vendor/github.com/google/go-github/v67/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issue_import.go rename to vendor/github.com/google/go-github/v67/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v59/github/issues.go b/vendor/github.com/google/go-github/v67/github/issues.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issues.go rename to vendor/github.com/google/go-github/v67/github/issues.go diff --git a/vendor/github.com/google/go-github/v59/github/issues_assignees.go b/vendor/github.com/google/go-github/v67/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issues_assignees.go rename to vendor/github.com/google/go-github/v67/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v59/github/issues_comments.go b/vendor/github.com/google/go-github/v67/github/issues_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issues_comments.go rename to vendor/github.com/google/go-github/v67/github/issues_comments.go diff --git a/vendor/github.com/google/go-github/v59/github/issues_events.go b/vendor/github.com/google/go-github/v67/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issues_events.go rename to vendor/github.com/google/go-github/v67/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v59/github/issues_labels.go b/vendor/github.com/google/go-github/v67/github/issues_labels.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/issues_labels.go rename to vendor/github.com/google/go-github/v67/github/issues_labels.go index 51e7fe6..b97b00f 100644 --- a/vendor/github.com/google/go-github/v59/github/issues_labels.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/issues_milestones.go b/vendor/github.com/google/go-github/v67/github/issues_milestones.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issues_milestones.go rename to vendor/github.com/google/go-github/v67/github/issues_milestones.go diff --git a/vendor/github.com/google/go-github/v59/github/issues_timeline.go b/vendor/github.com/google/go-github/v67/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/issues_timeline.go rename to vendor/github.com/google/go-github/v67/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v59/github/licenses.go b/vendor/github.com/google/go-github/v67/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/licenses.go rename to vendor/github.com/google/go-github/v67/github/licenses.go diff --git a/vendor/github.com/google/go-github/v59/github/markdown.go b/vendor/github.com/google/go-github/v67/github/markdown.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/markdown.go rename to vendor/github.com/google/go-github/v67/github/markdown.go diff --git a/vendor/github.com/google/go-github/v59/github/messages.go b/vendor/github.com/google/go-github/v67/github/messages.go similarity index 69% rename from vendor/github.com/google/go-github/v59/github/messages.go rename to vendor/github.com/google/go-github/v67/github/messages.go index 72edbd9..608c557 100644 --- a/vendor/github.com/google/go-github/v59/github/messages.go +++ b/vendor/github.com/google/go-github/v67/github/messages.go @@ -46,75 +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{}, - "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/v59/github/meta.go b/vendor/github.com/google/go-github/v67/github/meta.go similarity index 77% rename from vendor/github.com/google/go-github/v59/github/meta.go rename to vendor/github.com/google/go-github/v67/github/meta.go index 1da8fcf..cc90b61 100644 --- a/vendor/github.com/google/go-github/v59/github/meta.go +++ b/vendor/github.com/google/go-github/v67/github/meta.go @@ -17,11 +17,11 @@ type MetaService service // APIMeta represents metadata about the GitHub API. type APIMeta struct { - // An Array of IP addresses in CIDR format specifying the addresses + // An array of IP addresses in CIDR format specifying the addresses // that incoming service hooks will originate from on GitHub.com. Hooks []string `json:"hooks,omitempty"` - // An Array of IP addresses in CIDR format specifying the Git servers + // An array of IP addresses in CIDR format specifying the Git servers // for GitHub.com. Git []string `json:"git,omitempty"` @@ -40,10 +40,14 @@ type APIMeta struct { // which serve GitHub Pages websites. Pages []string `json:"pages,omitempty"` - // An Array of IP addresses specifying the addresses that source imports + // An array of IP addresses specifying the addresses that source imports // will originate from on GitHub.com. Importer []string `json:"importer,omitempty"` + // An array of IP addresses specifying the addresses that source imports + // will originate from on GitHub Enterprise Cloud. + GithubEnterpriseImporter []string `json:"github_enterprise_importer,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // GitHub Actions will originate from. Actions []string `json:"actions,omitempty"` @@ -65,6 +69,26 @@ type APIMeta struct { // An array of IP addresses in CIDR format specifying the addresses // which serve GitHub APIs. API []string `json:"api,omitempty"` + + // GitHub services and their associated domains. Note that many of these domains + // are represented as wildcards (e.g. "*.github.com"). + Domains *APIMetaDomains `json:"domains,omitempty"` +} + +// APIMetaDomains represents the domains associated with GitHub services. +type APIMetaDomains struct { + Website []string `json:"website,omitempty"` + Codespaces []string `json:"codespaces,omitempty"` + Copilot []string `json:"copilot,omitempty"` + Packages []string `json:"packages,omitempty"` + Actions []string `json:"actions,omitempty"` + ArtifactAttestations *APIMetaArtifactAttestations `json:"artifact_attestations,omitempty"` +} + +// APIMetaArtifactAttestations represents the artifact attestation services domains. +type APIMetaArtifactAttestations struct { + TrustDomain string `json:"trust_domain,omitempty"` + Services []string `json:"services,omitempty"` } // Get returns information about GitHub.com, the service. Or, if you access diff --git a/vendor/github.com/google/go-github/v59/github/migrations.go b/vendor/github.com/google/go-github/v67/github/migrations.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/migrations.go rename to vendor/github.com/google/go-github/v67/github/migrations.go diff --git a/vendor/github.com/google/go-github/v59/github/migrations_source_import.go b/vendor/github.com/google/go-github/v67/github/migrations_source_import.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v67/github/migrations_source_import.go index 3b16123..f484b77 100644 --- a/vendor/github.com/google/go-github/v59/github/migrations_source_import.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/migrations_user.go b/vendor/github.com/google/go-github/v67/github/migrations_user.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/migrations_user.go rename to vendor/github.com/google/go-github/v67/github/migrations_user.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs.go b/vendor/github.com/google/go-github/v67/github/orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs.go rename to vendor/github.com/google/go-github/v67/github/orgs.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v67/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v67/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v67/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v67/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v67/github/orgs_attestations.go b/vendor/github.com/google/go-github/v67/github/orgs_attestations.go new file mode 100644 index 0000000..3d5793c --- /dev/null +++ b/vendor/github.com/google/go-github/v67/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/v59/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v67/github/orgs_audit_log.go similarity index 93% rename from vendor/github.com/google/go-github/v59/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v67/github/orgs_audit_log.go index 28ac079..025c5d0 100644 --- a/vendor/github.com/google/go-github/v59/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v67/github/orgs_audit_log.go @@ -20,16 +20,6 @@ type GetAuditLogOptions struct { ListCursorOptions } -// HookConfig describes metadata about a webhook configuration. -type HookConfig struct { - ContentType *string `json:"content_type,omitempty"` - InsecureSSL *string `json:"insecure_ssl,omitempty"` - URL *string `json:"url,omitempty"` - - // Secret is returned obfuscated by GitHub, but it can be set for outgoing requests. - Secret *string `json:"secret,omitempty"` -} - // ActorLocation contains information about reported location for an actor. type ActorLocation struct { CountryCode *string `json:"country_code,omitempty"` diff --git a/vendor/github.com/google/go-github/v67/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v67/github/orgs_codesecurity_configurations.go new file mode 100644 index 0000000..b25845a --- /dev/null +++ b/vendor/github.com/google/go-github/v67/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/v59/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v67/github/orgs_credential_authorizations.go similarity index 83% rename from vendor/github.com/google/go-github/v59/github/orgs_credential_authorizations.go rename to vendor/github.com/google/go-github/v67/github/orgs_credential_authorizations.go index eed0f0c..dca4243 100644 --- a/vendor/github.com/google/go-github/v59/github/orgs_credential_authorizations.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/orgs_custom_roles.go b/vendor/github.com/google/go-github/v67/github/orgs_custom_repository_roles.go similarity index 80% rename from vendor/github.com/google/go-github/v59/github/orgs_custom_roles.go rename to vendor/github.com/google/go-github/v67/github/orgs_custom_repository_roles.go index 45de896..2295e1b 100644 --- a/vendor/github.com/google/go-github/v59/github/orgs_custom_roles.go +++ b/vendor/github.com/google/go-github/v67/github/orgs_custom_repository_roles.go @@ -1,4 +1,4 @@ -// Copyright 2022 The go-github AUTHORS. All rights reserved. +// 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. @@ -20,11 +20,22 @@ type OrganizationCustomRepoRoles struct { // 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"` + 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,omitempty"` + Permissions []string `json:"permissions"` } // ListCustomRepoRoles lists the custom repository roles available in this organization. @@ -50,21 +61,13 @@ func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org stri return customRepoRoles, resp, nil } -// CreateOrUpdateCustomRoleOptions represents options required to create or update a custom repository role. -type CreateOrUpdateCustomRoleOptions struct { - Name *string `json:"name,omitempty"` - Description *string `json:"description,omitempty"` - BaseRole *string `json:"base_role,omitempty"` - Permissions []string `json:"permissions,omitempty"` -} - // 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 *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { +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) @@ -87,7 +90,7 @@ func (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org str // 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, roleID string, opts *CreateOrUpdateCustomRoleOptions) (*CustomRepoRoles, *Response, error) { +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) @@ -110,7 +113,7 @@ func (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org, ro // 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, roleID string) (*Response, error) { +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) diff --git a/vendor/github.com/google/go-github/v59/github/orgs_hooks.go b/vendor/github.com/google/go-github/v67/github/orgs_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v67/github/orgs_hooks.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v67/github/orgs_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_hooks_configuration.go rename to vendor/github.com/google/go-github/v67/github/orgs_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v67/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v67/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_members.go b/vendor/github.com/google/go-github/v67/github/orgs_members.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/orgs_members.go rename to vendor/github.com/google/go-github/v67/github/orgs_members.go index 5bc2365..d818d7f 100644 --- a/vendor/github.com/google/go-github/v59/github/orgs_members.go +++ b/vendor/github.com/google/go-github/v67/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/v67/github/orgs_organization_roles.go b/vendor/github.com/google/go-github/v67/github/orgs_organization_roles.go new file mode 100644 index 0000000..0954b92 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/github/orgs_organization_roles.go @@ -0,0 +1,295 @@ +// Copyright 2022 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "fmt" +) + +// OrganizationCustomRoles represents custom organization roles available in specified organization. +type OrganizationCustomRoles struct { + TotalCount *int `json:"total_count,omitempty"` + CustomRepoRoles []*CustomOrgRoles `json:"roles,omitempty"` +} + +// CustomOrgRoles represents custom organization role available in specified organization. +type CustomOrgRoles struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Description *string `json:"description,omitempty"` + Permissions []string `json:"permissions,omitempty"` + Org *Organization `json:"organization,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Source *string `json:"source,omitempty"` + BaseRole *string `json:"base_role,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"` + BaseRole *string `json:"base_role,omitempty"` +} + +// ListRoles lists the custom roles available in this organization. +// In order to see custom roles in an organization, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization +// +//meta:operation GET /orgs/{org}/organization-roles +func (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*OrganizationCustomRoles, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + customRepoRoles := new(OrganizationCustomRoles) + resp, err := s.client.Do(ctx, req, customRepoRoles) + if err != nil { + return nil, resp, err + } + + 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/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) { + u := fmt.Sprintf("orgs/%v/organization-roles", org) + + req, err := s.client.NewRequest("POST", u, opts) + 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 +} + +// 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/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) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) + + req, err := s.client.NewRequest("PATCH", u, opts) + 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 +} + +// 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/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) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v", org, roleID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resultingRole := new(CustomOrgRoles) + resp, err := s.client.Do(ctx, req, resultingRole) + if err != nil { + return resp, err + } + + return resp, nil +} + +// 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/rest/orgs/organization-roles#assign-an-organization-role-to-a-team +// +//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("PUT", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// 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/rest/orgs/organization-roles#remove-an-organization-role-from-a-team +// +//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("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 +} + +// 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/rest/orgs/organization-roles#assign-an-organization-role-to-a-user +// +//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("PUT", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// 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/rest/orgs/organization-roles#remove-an-organization-role-from-a-user +// +//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 + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// ListTeamsAssignedToOrgRole returns all teams assigned to a specific organization role. +// In order to list teams assigned to an organization role, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role +// +//meta:operation GET /orgs/{org}/organization-roles/{role_id}/teams +func (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*Team, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v/teams", org, roleID) + 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 teams []*Team + resp, err := s.client.Do(ctx, req, &teams) + if err != nil { + return nil, resp, err + } + + return teams, resp, nil +} + +// ListUsersAssignedToOrgRole returns all users assigned to a specific organization role. +// In order to list users assigned to an organization role, the authenticated user must be an organization owner. +// +// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role +// +//meta:operation GET /orgs/{org}/organization-roles/{role_id}/users +func (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*User, *Response, error) { + u := fmt.Sprintf("orgs/%v/organization-roles/%v/users", org, roleID) + 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 users []*User + resp, err := s.client.Do(ctx, req, &users) + if err != nil { + return nil, resp, err + } + + return users, resp, nil +} diff --git a/vendor/github.com/google/go-github/v59/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v67/github/orgs_outside_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v67/github/orgs_outside_collaborators.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_packages.go b/vendor/github.com/google/go-github/v67/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_packages.go rename to vendor/github.com/google/go-github/v67/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v67/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v67/github/orgs_personal_access_tokens.go new file mode 100644 index 0000000..af08374 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/github/orgs_personal_access_tokens.go @@ -0,0 +1,167 @@ +// Copyright 2023 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" + "net/url" + "strings" +) + +// PersonalAccessToken represents the minimal representation of an organization programmatic access grant. +// +// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28 +type PersonalAccessToken struct { + // "Unique identifier of the fine-grained personal access token. + // The `pat_id` used to get details about an approved fine-grained personal access token. + ID *int64 `json:"id"` + + // Owner is the GitHub user associated with the token. + Owner *User `json:"owner"` + + // RepositorySelection is the type of repository selection requested. + // Possible values are: "none", "all", "subset". + RepositorySelection *string `json:"repository_selection"` + + // URL to the list of repositories the fine-grained personal access token can access. + // Only follow when `repository_selection` is `subset`. + RepositoriesURL *string `json:"repositories_url"` + + // Permissions are the permissions requested, categorized by type. + Permissions *PersonalAccessTokenPermissions `json:"permissions"` + + // Date and time when the fine-grained personal access token was approved to access the organization. + AccessGrantedAt *Timestamp `json:"access_granted_at"` + + // Whether the associated fine-grained personal access token has expired. + TokenExpired *bool `json:"token_expired"` + + // Date and time when the associated fine-grained personal access token expires. + TokenExpiresAt *Timestamp `json:"token_expires_at"` + + // Date and time when the associated fine-grained personal access token was last used for authentication. + TokenLastUsedAt *Timestamp `json:"token_last_used_at"` +} + +// ListFineGrainedPATOptions specifies optional parameters to ListFineGrainedPersonalAccessTokens. +type ListFineGrainedPATOptions struct { + // The property by which to sort the results. + // Default: created_at + // Value: created_at + Sort string `url:"sort,omitempty"` + + // The direction to sort the results by. + // Default: desc + // Value: asc, desc + Direction string `url:"direction,omitempty"` + + // A list of owner usernames to use to filter the results. + Owner []string `url:"-"` + + // The name of the repository to use to filter the results. + Repository string `url:"repository,omitempty"` + + // The permission to use to filter the results. + Permission string `url:"permission,omitempty"` + + // Only show fine-grained personal access tokens used before the given time. + // This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + LastUsedBefore string `url:"last_used_before,omitempty"` + + // Only show fine-grained personal access tokens used after the given time. + // This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + LastUsedAfter string `url:"last_used_after,omitempty"` + + ListOptions +} + +// ListFineGrainedPersonalAccessTokens lists approved fine-grained personal access tokens owned by organization members that can access organization resources. +// Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read). +// +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources +// +//meta:operation GET /orgs/{org}/personal-access-tokens +func (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*PersonalAccessToken, *Response, error) { + u := fmt.Sprintf("orgs/%v/personal-access-tokens", org) + // The `owner` parameter is a special case that uses the `owner[]=...` format and needs a custom function to format it correctly. + u, err := addListFineGrainedPATOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest(http.MethodGet, u, opts) + if err != nil { + return nil, nil, err + } + + var pats []*PersonalAccessToken + + resp, err := s.client.Do(ctx, req, &pats) + if err != nil { + return nil, resp, err + } + + return pats, resp, nil +} + +// ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method. +type ReviewPersonalAccessTokenRequestOptions struct { + Action string `json:"action"` + Reason *string `json:"reason,omitempty"` +} + +// ReviewPersonalAccessTokenRequest approves or denies a pending request to access organization resources via a fine-grained personal access token. +// Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission. +// `action` can be one of `approve` or `deny`. +// +// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +// +//meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id} +func (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) { + u := fmt.Sprintf("orgs/%v/personal-access-token-requests/%v", org, requestID) + + req, err := s.client.NewRequest(http.MethodPost, u, &opts) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// addListFineGrainedPATOptions adds the owner parameter to the URL query string with the correct format if it is set. +// +// GitHub API expects the owner parameter to be a list of strings in the `owner[]=...` format. +// For multiple owner values, the owner parameter is repeated in the query string. +// +// Example: +// owner[]=user1&owner[]=user2 +// This will filter the results to only include fine-grained personal access tokens owned by `user1` and `user2`. +// +// This function ensures the owner parameter is formatted correctly in the URL query string. +func addListFineGrainedPATOptions(s string, opts *ListFineGrainedPATOptions) (string, error) { + u, err := addOptions(s, opts) + if err != nil { + return s, err + } + + if len(opts.Owner) > 0 { + ownerVals := make([]string, len(opts.Owner)) + for i, owner := range opts.Owner { + ownerVals[i] = fmt.Sprintf("owner[]=%s", url.QueryEscape(owner)) + } + ownerQuery := strings.Join(ownerVals, "&") + + if strings.Contains(u, "?") { + u += "&" + ownerQuery + } else { + u += "?" + ownerQuery + } + } + + return u, nil +} diff --git a/vendor/github.com/google/go-github/v59/github/orgs_projects.go b/vendor/github.com/google/go-github/v67/github/orgs_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_projects.go rename to vendor/github.com/google/go-github/v67/github/orgs_projects.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_properties.go b/vendor/github.com/google/go-github/v67/github/orgs_properties.go similarity index 80% rename from vendor/github.com/google/go-github/v59/github/orgs_properties.go rename to vendor/github.com/google/go-github/v67/github/orgs_properties.go index 2e88b7f..d4fe5df 100644 --- a/vendor/github.com/google/go-github/v59/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v67/github/orgs_properties.go @@ -7,6 +7,8 @@ package github import ( "context" + "encoding/json" + "errors" "fmt" ) @@ -15,12 +17,19 @@ type CustomProperty struct { // PropertyName is required for most endpoints except when calling CreateOrUpdateCustomProperty; // where this is sent in the path and thus can be omitted. PropertyName *string `json:"property_name,omitempty"` - // Possible values for ValueType are: string, single_select - ValueType string `json:"value_type"` - Required *bool `json:"required,omitempty"` - DefaultValue *string `json:"default_value,omitempty"` - Description *string `json:"description,omitempty"` + // The type of the value for the property. Can be one of: string, single_select. + ValueType string `json:"value_type"` + // Whether the property is required. + Required *bool `json:"required,omitempty"` + // Default value of the property. + DefaultValue *string `json:"default_value,omitempty"` + // Short description of the property. + Description *string `json:"description,omitempty"` + // An ordered list of the allowed values of the property. The property can have up to 200 + // allowed values. AllowedValues []string `json:"allowed_values,omitempty"` + // Who can edit the values of the property. Can be one of: org_actors, org_and_repo_actors, nil (null). + ValuesEditableBy *string `json:"values_editable_by,omitempty"` } // RepoCustomPropertyValue represents a repository custom property value. @@ -33,8 +42,42 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { - PropertyName string `json:"property_name"` - Value *string `json:"value,omitempty"` + PropertyName string `json:"property_name"` + Value interface{} `json:"value"` +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +// This helps us handle the fact that Value can be either a string, []string, or nil. +func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { + type aliasCustomPropertyValue CustomPropertyValue + aux := &struct { + *aliasCustomPropertyValue + }{ + aliasCustomPropertyValue: (*aliasCustomPropertyValue)(cpv), + } + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + + switch v := aux.Value.(type) { + case nil: + cpv.Value = nil + case string: + cpv.Value = v + case []interface{}: + strSlice := make([]string, len(v)) + for i, item := range v { + str, ok := item.(string) + if !ok { + return errors.New("non-string value in string array") + } + strSlice[i] = str + } + cpv.Value = strSlice + default: + return fmt.Errorf("unexpected value type: %T", v) + } + return nil } // GetAllCustomProperties gets all custom properties that are defined for the specified organization. diff --git a/vendor/github.com/google/go-github/v59/github/orgs_rules.go b/vendor/github.com/google/go-github/v67/github/orgs_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_rules.go rename to vendor/github.com/google/go-github/v67/github/orgs_rules.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v67/github/orgs_security_managers.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v67/github/orgs_security_managers.go diff --git a/vendor/github.com/google/go-github/v59/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v67/github/orgs_users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v67/github/orgs_users_blocking.go diff --git a/vendor/github.com/google/go-github/v59/github/packages.go b/vendor/github.com/google/go-github/v67/github/packages.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/packages.go rename to vendor/github.com/google/go-github/v67/github/packages.go diff --git a/vendor/github.com/google/go-github/v59/github/projects.go b/vendor/github.com/google/go-github/v67/github/projects.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/projects.go rename to vendor/github.com/google/go-github/v67/github/projects.go diff --git a/vendor/github.com/google/go-github/v59/github/pulls.go b/vendor/github.com/google/go-github/v67/github/pulls.go similarity index 96% rename from vendor/github.com/google/go-github/v59/github/pulls.go rename to vendor/github.com/google/go-github/v67/github/pulls.go index 80df9fa..35ceda4 100644 --- a/vendor/github.com/google/go-github/v59/github/pulls.go +++ b/vendor/github.com/google/go-github/v67/github/pulls.go @@ -8,6 +8,7 @@ package github import ( "bytes" "context" + "errors" "fmt" ) @@ -250,9 +251,16 @@ func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo str // NewPullRequest represents a new pull request to be created. type NewPullRequest struct { - Title *string `json:"title,omitempty"` - Head *string `json:"head,omitempty"` - HeadRepo *string `json:"head_repo,omitempty"` + Title *string `json:"title,omitempty"` + // The name of the branch where your changes are implemented. For + // cross-repository pull requests in the same network, namespace head with + // a user like this: username:branch. + Head *string `json:"head,omitempty"` + HeadRepo *string `json:"head_repo,omitempty"` + // The name of the branch you want the changes pulled into. This should be + // an existing branch on the current repository. You cannot submit a pull + // request to one repository that requests a merge to a base of another + // repository. Base *string `json:"base,omitempty"` Body *string `json:"body,omitempty"` Issue *int `json:"issue,omitempty"` @@ -345,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/v59/github/pulls_comments.go b/vendor/github.com/google/go-github/v67/github/pulls_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/pulls_comments.go rename to vendor/github.com/google/go-github/v67/github/pulls_comments.go diff --git a/vendor/github.com/google/go-github/v59/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v67/github/pulls_reviewers.go similarity index 76% rename from vendor/github.com/google/go-github/v59/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v67/github/pulls_reviewers.go index 3f0c50b..9dd60ae 100644 --- a/vendor/github.com/google/go-github/v59/github/pulls_reviewers.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/pulls_reviews.go b/vendor/github.com/google/go-github/v67/github/pulls_reviews.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v67/github/pulls_reviews.go diff --git a/vendor/github.com/google/go-github/v59/github/pulls_threads.go b/vendor/github.com/google/go-github/v67/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/pulls_threads.go rename to vendor/github.com/google/go-github/v67/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v59/github/rate_limit.go b/vendor/github.com/google/go-github/v67/github/rate_limit.go similarity index 81% rename from vendor/github.com/google/go-github/v59/github/rate_limit.go rename to vendor/github.com/google/go-github/v67/github/rate_limit.go index febe5ed..5b01b57 100644 --- a/vendor/github.com/google/go-github/v59/github/rate_limit.go +++ b/vendor/github.com/google/go-github/v67/github/rate_limit.go @@ -54,6 +54,7 @@ type RateLimits struct { SCIM *Rate `json:"scim"` DependencySnapshots *Rate `json:"dependency_snapshots"` CodeSearch *Rate `json:"code_search"` + AuditLog *Rate `json:"audit_log"` } func (r RateLimits) String() string { @@ -85,34 +86,37 @@ func (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, err if response.Resources != nil { s.client.rateMu.Lock() if response.Resources.Core != nil { - s.client.rateLimits[coreCategory] = *response.Resources.Core + s.client.rateLimits[CoreCategory] = *response.Resources.Core } if response.Resources.Search != nil { - s.client.rateLimits[searchCategory] = *response.Resources.Search + s.client.rateLimits[SearchCategory] = *response.Resources.Search } if response.Resources.GraphQL != nil { - s.client.rateLimits[graphqlCategory] = *response.Resources.GraphQL + s.client.rateLimits[GraphqlCategory] = *response.Resources.GraphQL } if response.Resources.IntegrationManifest != nil { - s.client.rateLimits[integrationManifestCategory] = *response.Resources.IntegrationManifest + s.client.rateLimits[IntegrationManifestCategory] = *response.Resources.IntegrationManifest } if response.Resources.SourceImport != nil { - s.client.rateLimits[sourceImportCategory] = *response.Resources.SourceImport + s.client.rateLimits[SourceImportCategory] = *response.Resources.SourceImport } if response.Resources.CodeScanningUpload != nil { - s.client.rateLimits[codeScanningUploadCategory] = *response.Resources.CodeScanningUpload + s.client.rateLimits[CodeScanningUploadCategory] = *response.Resources.CodeScanningUpload } if response.Resources.ActionsRunnerRegistration != nil { - s.client.rateLimits[actionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration + s.client.rateLimits[ActionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration } if response.Resources.SCIM != nil { - s.client.rateLimits[scimCategory] = *response.Resources.SCIM + s.client.rateLimits[ScimCategory] = *response.Resources.SCIM } if response.Resources.DependencySnapshots != nil { - s.client.rateLimits[dependencySnapshotsCategory] = *response.Resources.DependencySnapshots + s.client.rateLimits[DependencySnapshotsCategory] = *response.Resources.DependencySnapshots } if response.Resources.CodeSearch != nil { - s.client.rateLimits[codeSearchCategory] = *response.Resources.CodeSearch + s.client.rateLimits[CodeSearchCategory] = *response.Resources.CodeSearch + } + if response.Resources.AuditLog != nil { + s.client.rateLimits[AuditLogCategory] = *response.Resources.AuditLog } s.client.rateMu.Unlock() } diff --git a/vendor/github.com/google/go-github/v59/github/reactions.go b/vendor/github.com/google/go-github/v67/github/reactions.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/reactions.go rename to vendor/github.com/google/go-github/v67/github/reactions.go diff --git a/vendor/github.com/google/go-github/v59/github/repos.go b/vendor/github.com/google/go-github/v67/github/repos.go similarity index 93% rename from vendor/github.com/google/go-github/v59/github/repos.go rename to vendor/github.com/google/go-github/v67/github/repos.go index b492e55..9faed40 100644 --- a/vendor/github.com/google/go-github/v59/github/repos.go +++ b/vendor/github.com/google/go-github/v67/github/repos.go @@ -27,59 +27,59 @@ type RepositoriesService service // Repository represents a GitHub repository. type Repository struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Owner *User `json:"owner,omitempty"` - Name *string `json:"name,omitempty"` - FullName *string `json:"full_name,omitempty"` - Description *string `json:"description,omitempty"` - Homepage *string `json:"homepage,omitempty"` - CodeOfConduct *CodeOfConduct `json:"code_of_conduct,omitempty"` - DefaultBranch *string `json:"default_branch,omitempty"` - MasterBranch *string `json:"master_branch,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PushedAt *Timestamp `json:"pushed_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CloneURL *string `json:"clone_url,omitempty"` - GitURL *string `json:"git_url,omitempty"` - MirrorURL *string `json:"mirror_url,omitempty"` - SSHURL *string `json:"ssh_url,omitempty"` - SVNURL *string `json:"svn_url,omitempty"` - Language *string `json:"language,omitempty"` - Fork *bool `json:"fork,omitempty"` - ForksCount *int `json:"forks_count,omitempty"` - NetworkCount *int `json:"network_count,omitempty"` - OpenIssuesCount *int `json:"open_issues_count,omitempty"` - OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated. - StargazersCount *int `json:"stargazers_count,omitempty"` - SubscribersCount *int `json:"subscribers_count,omitempty"` - WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated. - Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated. - Size *int `json:"size,omitempty"` - AutoInit *bool `json:"auto_init,omitempty"` - Parent *Repository `json:"parent,omitempty"` - Source *Repository `json:"source,omitempty"` - TemplateRepository *Repository `json:"template_repository,omitempty"` - Organization *Organization `json:"organization,omitempty"` - Permissions map[string]bool `json:"permissions,omitempty"` - AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"` - AllowUpdateBranch *bool `json:"allow_update_branch,omitempty"` - AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"` - AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` - AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` - AllowForking *bool `json:"allow_forking,omitempty"` - WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` - DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` - SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" - SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" - MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" - MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" - Topics []string `json:"topics,omitempty"` - CustomProperties map[string]string `json:"custom_properties,omitempty"` - Archived *bool `json:"archived,omitempty"` - Disabled *bool `json:"disabled,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Owner *User `json:"owner,omitempty"` + Name *string `json:"name,omitempty"` + FullName *string `json:"full_name,omitempty"` + Description *string `json:"description,omitempty"` + Homepage *string `json:"homepage,omitempty"` + CodeOfConduct *CodeOfConduct `json:"code_of_conduct,omitempty"` + DefaultBranch *string `json:"default_branch,omitempty"` + MasterBranch *string `json:"master_branch,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PushedAt *Timestamp `json:"pushed_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + CloneURL *string `json:"clone_url,omitempty"` + GitURL *string `json:"git_url,omitempty"` + MirrorURL *string `json:"mirror_url,omitempty"` + SSHURL *string `json:"ssh_url,omitempty"` + SVNURL *string `json:"svn_url,omitempty"` + Language *string `json:"language,omitempty"` + Fork *bool `json:"fork,omitempty"` + ForksCount *int `json:"forks_count,omitempty"` + NetworkCount *int `json:"network_count,omitempty"` + OpenIssuesCount *int `json:"open_issues_count,omitempty"` + OpenIssues *int `json:"open_issues,omitempty"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated. + StargazersCount *int `json:"stargazers_count,omitempty"` + SubscribersCount *int `json:"subscribers_count,omitempty"` + WatchersCount *int `json:"watchers_count,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated. + Watchers *int `json:"watchers,omitempty"` // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated. + Size *int `json:"size,omitempty"` + AutoInit *bool `json:"auto_init,omitempty"` + Parent *Repository `json:"parent,omitempty"` + Source *Repository `json:"source,omitempty"` + TemplateRepository *Repository `json:"template_repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Permissions map[string]bool `json:"permissions,omitempty"` + AllowRebaseMerge *bool `json:"allow_rebase_merge,omitempty"` + AllowUpdateBranch *bool `json:"allow_update_branch,omitempty"` + AllowSquashMerge *bool `json:"allow_squash_merge,omitempty"` + AllowMergeCommit *bool `json:"allow_merge_commit,omitempty"` + AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` + AllowForking *bool `json:"allow_forking,omitempty"` + WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` + DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" + Topics []string `json:"topics,omitempty"` + CustomProperties map[string]interface{} `json:"custom_properties,omitempty"` + Archived *bool `json:"archived,omitempty"` + Disabled *bool `json:"disabled,omitempty"` // Only provided when using RepositoriesService.Get while in preview License *License `json:"license,omitempty"` @@ -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,11 +998,19 @@ 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"` Protected *bool `json:"protected,omitempty"` + + // Protection will always be included in APIs which return the + // 'Branch With Protection' schema such as 'Get a branch', but may + // not be included in APIs that return the `Short Branch` schema + // such as 'List branches'. In such cases, if branch protection is + // enabled, Protected will be `true` but this will be nil, and + // additional protection details can be obtained by calling GetBranch(). + Protection *Protection `json:"protection,omitempty"` } // Protection represents a repository branch's protection. @@ -1191,20 +1199,20 @@ type RequiredStatusChecks struct { // Require branches to be up to date before merging. (Required.) Strict bool `json:"strict"` // The list of status checks to require in order to merge into this - // branch. (Deprecated. Note: only one of Contexts/Checks can be populated, - // but at least one must be populated). - Contexts []string `json:"contexts,omitempty"` + // branch. An empty slice is valid. (Deprecated. Note: only one of + // Contexts/Checks can be populated, but at least one must be populated). + Contexts *[]string `json:"contexts,omitempty"` // The list of status checks to require in order to merge into this - // branch. - Checks []*RequiredStatusCheck `json:"checks,omitempty"` - ContextsURL *string `json:"contexts_url,omitempty"` - URL *string `json:"url,omitempty"` + // branch. An empty slice is valid. + Checks *[]*RequiredStatusCheck `json:"checks,omitempty"` + ContextsURL *string `json:"contexts_url,omitempty"` + URL *string `json:"url,omitempty"` } // RequiredStatusChecksRequest represents a request to edit a protected branch's status checks. type RequiredStatusChecksRequest struct { Strict *bool `json:"strict,omitempty"` - // Note: if both Contexts and Checks are populated, + // Deprecated. Note: if both Contexts and Checks are populated, // the GitHub API will only use Checks. Contexts []string `json:"contexts,omitempty"` Checks []*RequiredStatusCheck `json:"checks,omitempty"` @@ -1355,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"` @@ -1364,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. @@ -2394,3 +2402,27 @@ func (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner return resp, nil } + +// checkPrivateReporting represents whether private vulnerability reporting is enabled. +type checkPrivateReporting struct { + Enabled bool `json:"enabled,omitempty"` +} + +// IsPrivateReportingEnabled checks if private vulnerability reporting is enabled +// for the repository and returns a boolean indicating the status. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/private-vulnerability-reporting +func (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, owner, repo string) (bool, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/private-vulnerability-reporting", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return false, nil, err + } + + privateReporting := new(checkPrivateReporting) + resp, err := s.client.Do(ctx, req, privateReporting) + return privateReporting.Enabled, resp, err +} diff --git a/vendor/github.com/google/go-github/v59/github/repos_actions_access.go b/vendor/github.com/google/go-github/v67/github/repos_actions_access.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v67/github/repos_actions_access.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v67/github/repos_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v67/github/repos_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v67/github/repos_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v67/github/repos_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v67/github/repos_attestations.go b/vendor/github.com/google/go-github/v67/github/repos_attestations.go new file mode 100644 index 0000000..2e54255 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/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/v59/github/repos_autolinks.go b/vendor/github.com/google/go-github/v67/github/repos_autolinks.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v67/github/repos_autolinks.go index 200605a..6c209b2 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_autolinks.go +++ b/vendor/github.com/google/go-github/v67/github/repos_autolinks.go @@ -28,7 +28,7 @@ type Autolink struct { // ListAutolinks returns a list of autolinks configured for the given repository. // Information about autolinks are only available to repository administrators. // -// GitHub API docs: https://docs.github.com/rest/repos/autolinks#list-all-autolinks-of-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository // //meta:operation GET /repos/{owner}/{repo}/autolinks func (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Autolink, *Response, error) { diff --git a/vendor/github.com/google/go-github/v59/github/repos_codeowners.go b/vendor/github.com/google/go-github/v67/github/repos_codeowners.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v67/github/repos_codeowners.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_collaborators.go b/vendor/github.com/google/go-github/v67/github/repos_collaborators.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v67/github/repos_collaborators.go index 15a4e77..d6c9853 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_collaborators.go +++ b/vendor/github.com/google/go-github/v67/github/repos_collaborators.go @@ -99,6 +99,8 @@ type RepositoryPermissionLevel struct { Permission *string `json:"permission,omitempty"` User *User `json:"user,omitempty"` + + RoleName *string `json:"role_name,omitempty"` } // GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository. diff --git a/vendor/github.com/google/go-github/v59/github/repos_comments.go b/vendor/github.com/google/go-github/v67/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_comments.go rename to vendor/github.com/google/go-github/v67/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_commits.go b/vendor/github.com/google/go-github/v67/github/repos_commits.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_commits.go rename to vendor/github.com/google/go-github/v67/github/repos_commits.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_community_health.go b/vendor/github.com/google/go-github/v67/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_community_health.go rename to vendor/github.com/google/go-github/v67/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_contents.go b/vendor/github.com/google/go-github/v67/github/repos_contents.go similarity index 96% rename from vendor/github.com/google/go-github/v59/github/repos_contents.go rename to vendor/github.com/google/go-github/v67/github/repos_contents.go index 9539a5c..3a0c266 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v67/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"` } @@ -150,7 +150,11 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, return nil, resp, fmt.Errorf("no download link found for %s", filepath) } - dlResp, err := s.client.client.Get(*contents.DownloadURL) + dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) + if err != nil { + return nil, resp, err + } + dlResp, err := s.client.client.Do(dlReq) if err != nil { return nil, &Response{Response: dlResp}, err } @@ -188,7 +192,11 @@ func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owne return nil, contents, resp, fmt.Errorf("no download link found for %s", filepath) } - dlResp, err := s.client.client.Get(*contents.DownloadURL) + dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) + if err != nil { + return nil, contents, resp, err + } + dlResp, err := s.client.client.Do(dlReq) if err != nil { return nil, contents, &Response{Response: dlResp}, err } @@ -346,7 +354,7 @@ func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo st } defer resp.Body.Close() - if resp.StatusCode != http.StatusFound { + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusFound { return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status) } diff --git a/vendor/github.com/google/go-github/v59/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v67/github/repos_deployment_branch_policies.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v67/github/repos_deployment_branch_policies.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_deployment_protection_rules.go b/vendor/github.com/google/go-github/v67/github/repos_deployment_protection_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_deployment_protection_rules.go rename to vendor/github.com/google/go-github/v67/github/repos_deployment_protection_rules.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_deployments.go b/vendor/github.com/google/go-github/v67/github/repos_deployments.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/repos_deployments.go rename to vendor/github.com/google/go-github/v67/github/repos_deployments.go index d8c0b63..6277ac2 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/repos_environments.go b/vendor/github.com/google/go-github/v67/github/repos_environments.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_environments.go rename to vendor/github.com/google/go-github/v67/github/repos_environments.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_forks.go b/vendor/github.com/google/go-github/v67/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_forks.go rename to vendor/github.com/google/go-github/v67/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_hooks.go b/vendor/github.com/google/go-github/v67/github/repos_hooks.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/repos_hooks.go rename to vendor/github.com/google/go-github/v67/github/repos_hooks.go index 3edf647..d221db2 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v67/github/repos_hooks.go @@ -51,9 +51,9 @@ type Hook struct { // Only the following fields are used when creating a hook. // Config is required. - Config map[string]interface{} `json:"config,omitempty"` - Events []string `json:"events,omitempty"` - Active *bool `json:"active,omitempty"` + Config *HookConfig `json:"config,omitempty"` + Events []string `json:"events,omitempty"` + Active *bool `json:"active,omitempty"` } func (h Hook) String() string { @@ -67,10 +67,10 @@ func (h Hook) String() string { // information. type createHookRequest struct { // Config is required. - Name string `json:"name"` - Config map[string]interface{} `json:"config,omitempty"` - Events []string `json:"events,omitempty"` - Active *bool `json:"active,omitempty"` + Name string `json:"name"` + Config *HookConfig `json:"config,omitempty"` + Events []string `json:"events,omitempty"` + Active *bool `json:"active,omitempty"` } // CreateHook creates a Hook for the specified repository. diff --git a/vendor/github.com/google/go-github/v59/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v67/github/repos_hooks_configuration.go similarity index 69% rename from vendor/github.com/google/go-github/v59/github/repos_hooks_configuration.go rename to vendor/github.com/google/go-github/v67/github/repos_hooks_configuration.go index b58eb24..9560bd7 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_hooks_configuration.go +++ b/vendor/github.com/google/go-github/v67/github/repos_hooks_configuration.go @@ -10,6 +10,21 @@ import ( "fmt" ) +// HookConfig describes metadata about a webhook configuration. +type HookConfig struct { + // The media type used to serialize the payloads + // Possible values are `json` and `form`, the field is not specified the default is `form` + ContentType *string `json:"content_type,omitempty"` + // The possible values are 0 and 1. + // Setting it to 1 will allow skip certificate verification for the host, + // potentially exposing to MitM attacks: https://en.wikipedia.org/wiki/Man-in-the-middle_attack + InsecureSSL *string `json:"insecure_ssl,omitempty"` + URL *string `json:"url,omitempty"` + + // Secret is returned obfuscated by GitHub, but it can be set for outgoing requests. + Secret *string `json:"secret,omitempty"` +} + // GetHookConfiguration returns the configuration for the specified repository webhook. // // GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository diff --git a/vendor/github.com/google/go-github/v59/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v67/github/repos_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v67/github/repos_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_invitations.go b/vendor/github.com/google/go-github/v67/github/repos_invitations.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/repos_invitations.go rename to vendor/github.com/google/go-github/v67/github/repos_invitations.go index 4922e0b..98fe01d 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/repos_keys.go b/vendor/github.com/google/go-github/v67/github/repos_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_keys.go rename to vendor/github.com/google/go-github/v67/github/repos_keys.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_lfs.go b/vendor/github.com/google/go-github/v67/github/repos_lfs.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_lfs.go rename to vendor/github.com/google/go-github/v67/github/repos_lfs.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_merging.go b/vendor/github.com/google/go-github/v67/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_merging.go rename to vendor/github.com/google/go-github/v67/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_pages.go b/vendor/github.com/google/go-github/v67/github/repos_pages.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_pages.go rename to vendor/github.com/google/go-github/v67/github/repos_pages.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v67/github/repos_prereceive_hooks.go similarity index 93% rename from vendor/github.com/google/go-github/v59/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v67/github/repos_prereceive_hooks.go index b1d3f3c..e97075d 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/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.15/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.11/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.15/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.11/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.15/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/v59/github/repos_projects.go b/vendor/github.com/google/go-github/v67/github/repos_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_projects.go rename to vendor/github.com/google/go-github/v67/github/repos_projects.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_properties.go b/vendor/github.com/google/go-github/v67/github/repos_properties.go similarity index 53% rename from vendor/github.com/google/go-github/v59/github/repos_properties.go rename to vendor/github.com/google/go-github/v67/github/repos_properties.go index 5a8626c..5b12bc8 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_properties.go +++ b/vendor/github.com/google/go-github/v67/github/repos_properties.go @@ -31,3 +31,30 @@ func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, or return customPropertyValues, resp, nil } + +// CreateOrUpdateCustomProperties creates new or updates existing custom property values for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository +// +//meta:operation PATCH /repos/{owner}/{repo}/properties/values +func (s *RepositoriesService) CreateOrUpdateCustomProperties(ctx context.Context, org, repo string, customPropertyValues []*CustomPropertyValue) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/properties/values", org, repo) + + params := struct { + Properties []*CustomPropertyValue `json:"properties"` + }{ + Properties: customPropertyValues, + } + + req, err := s.client.NewRequest("PATCH", u, params) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} diff --git a/vendor/github.com/google/go-github/v59/github/repos_releases.go b/vendor/github.com/google/go-github/v67/github/repos_releases.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_releases.go rename to vendor/github.com/google/go-github/v67/github/repos_releases.go diff --git a/vendor/github.com/google/go-github/v67/github/repos_rules.go b/vendor/github.com/google/go-github/v67/github/repos_rules.go new file mode 100644 index 0000000..b113553 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/github/repos_rules.go @@ -0,0 +1,995 @@ +// Copyright 2023 The go-github AUTHORS. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package github + +import ( + "context" + "encoding/json" + "fmt" +) + +// BypassActor represents the bypass actors from a ruleset. +type BypassActor struct { + ActorID *int64 `json:"actor_id,omitempty"` + // Possible values for ActorType are: RepositoryRole, Team, Integration, OrganizationAdmin + ActorType *string `json:"actor_type,omitempty"` + // Possible values for BypassMode are: always, pull_request + BypassMode *string `json:"bypass_mode,omitempty"` +} + +// RulesetLink represents a single link object from GitHub ruleset request _links. +type RulesetLink struct { + HRef *string `json:"href,omitempty"` +} + +// RulesetLinks represents the "_links" object in a Ruleset. +type RulesetLinks struct { + Self *RulesetLink `json:"self,omitempty"` +} + +// RulesetRefConditionParameters represents the conditions object for ref_names. +type RulesetRefConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` +} + +// RulesetRepositoryNamesConditionParameters represents the conditions object for repository_names. +type RulesetRepositoryNamesConditionParameters struct { + Include []string `json:"include"` + Exclude []string `json:"exclude"` + Protected *bool `json:"protected,omitempty"` +} + +// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids. +type RulesetRepositoryIDsConditionParameters struct { + RepositoryIDs []int64 `json:"repository_ids,omitempty"` +} + +// RulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting. +type RulesetRepositoryPropertyTargetParameters struct { + Name string `json:"name"` + Values []string `json:"property_values"` + Source *string `json:"source,omitempty"` +} + +// RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property. +type RulesetRepositoryPropertyConditionParameters struct { + Include []RulesetRepositoryPropertyTargetParameters `json:"include"` + Exclude []RulesetRepositoryPropertyTargetParameters `json:"exclude"` +} + +// RulesetConditions represents the conditions object in a ruleset. +// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one. +type RulesetConditions struct { + RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"` + RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"` + RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"` + RepositoryProperty *RulesetRepositoryPropertyConditionParameters `json:"repository_property,omitempty"` +} + +// RulePatternParameters represents the rule pattern parameters. +type RulePatternParameters struct { + Name *string `json:"name,omitempty"` + // If Negate is true, the rule will fail if the pattern matches. + Negate *bool `json:"negate,omitempty"` + // Possible values for Operator are: starts_with, ends_with, contains, regex + Operator string `json:"operator"` + Pattern string `json:"pattern"` +} + +// RuleFileParameters represents a list of file paths. +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"` +} + +// RequiredDeploymentEnvironmentsRuleParameters represents the required_deployments rule parameters. +type RequiredDeploymentEnvironmentsRuleParameters struct { + RequiredDeploymentEnvironments []string `json:"required_deployment_environments"` +} + +// PullRequestRuleParameters represents the pull_request rule parameters. +type PullRequestRuleParameters struct { + DismissStaleReviewsOnPush bool `json:"dismiss_stale_reviews_on_push"` + RequireCodeOwnerReview bool `json:"require_code_owner_review"` + RequireLastPushApproval bool `json:"require_last_push_approval"` + RequiredApprovingReviewCount int `json:"required_approving_review_count"` + RequiredReviewThreadResolution bool `json:"required_review_thread_resolution"` +} + +// RuleRequiredStatusChecks represents the RequiredStatusChecks for the RequiredStatusChecksRuleParameters object. +type RuleRequiredStatusChecks struct { + Context string `json:"context"` + IntegrationID *int64 `json:"integration_id,omitempty"` +} + +// MergeQueueRuleParameters represents the merge_queue rule parameters. +type MergeQueueRuleParameters struct { + CheckResponseTimeoutMinutes int `json:"check_response_timeout_minutes"` + // Possible values for GroupingStrategy are: ALLGREEN, HEADGREEN + GroupingStrategy string `json:"grouping_strategy"` + MaxEntriesToBuild int `json:"max_entries_to_build"` + MaxEntriesToMerge int `json:"max_entries_to_merge"` + // Possible values for MergeMethod are: MERGE, SQUASH, REBASE + MergeMethod string `json:"merge_method"` + MinEntriesToMerge int `json:"min_entries_to_merge"` + MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` +} + +// RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters. +type RequiredStatusChecksRuleParameters struct { + DoNotEnforceOnCreate *bool `json:"do_not_enforce_on_create,omitempty"` + RequiredStatusChecks []RuleRequiredStatusChecks `json:"required_status_checks"` + StrictRequiredStatusChecksPolicy bool `json:"strict_required_status_checks_policy"` +} + +// RuleRequiredWorkflow represents the Workflow for the RequireWorkflowsRuleParameters object. +type RuleRequiredWorkflow struct { + Path string `json:"path"` + Ref *string `json:"ref,omitempty"` + RepositoryID *int64 `json:"repository_id,omitempty"` + Sha *string `json:"sha,omitempty"` +} + +// RequiredWorkflowsRuleParameters represents the workflows rule parameters. +type RequiredWorkflowsRuleParameters struct { + 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. +type RepositoryRule struct { + Type string `json:"type"` + Parameters *json.RawMessage `json:"parameters,omitempty"` + RulesetSourceType string `json:"ruleset_source_type"` + RulesetSource string `json:"ruleset_source"` + 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 { + type rule RepositoryRule + var repositoryRule rule + if err := json.Unmarshal(data, &repositoryRule); err != nil { + return err + } + + r.RulesetID = repositoryRule.RulesetID + r.RulesetSourceType = repositoryRule.RulesetSourceType + r.RulesetSource = repositoryRule.RulesetSource + r.Type = repositoryRule.Type + + switch repositoryRule.Type { + case "creation", "deletion", "non_fast_forward", "required_linear_history", "required_signatures": + r.Parameters = nil + case "update": + if repositoryRule.Parameters == nil { + r.Parameters = nil + return nil + } + params := UpdateAllowsFetchAndMergeRuleParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "merge_queue": + if repositoryRule.Parameters == nil { + r.Parameters = nil + return nil + } + params := MergeQueueRuleParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "required_deployments": + params := RequiredDeploymentEnvironmentsRuleParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "commit_message_pattern", "commit_author_email_pattern", "committer_email_pattern", "branch_name_pattern", "tag_name_pattern": + params := RulePatternParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "pull_request": + params := PullRequestRuleParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "required_status_checks": + params := RequiredStatusChecksRuleParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "workflows": + params := RequiredWorkflowsRuleParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + + bytes, _ := json.Marshal(params) + rawParams := json.RawMessage(bytes) + + r.Parameters = &rawParams + case "file_path_restriction": + params := RuleFileParameters{} + if err := json.Unmarshal(*repositoryRule.Parameters, ¶ms); err != nil { + return err + } + 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 = "" + r.Parameters = nil + return fmt.Errorf("RepositoryRule.Type %q is not yet implemented, unable to unmarshal (%#v)", repositoryRule.Type, repositoryRule) + } + + return nil +} + +// NewMergeQueueRule creates a rule to only allow merges via a merge queue. +func NewMergeQueueRule(params *MergeQueueRuleParameters) (rule *RepositoryRule) { + if params != nil { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "merge_queue", + Parameters: &rawParams, + } + } + return &RepositoryRule{ + Type: "merge_queue", + } +} + +// NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. +func NewCreationRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "creation", + } +} + +// NewUpdateRule creates a rule to only allow users with bypass permission to update matching refs. +func NewUpdateRule(params *UpdateAllowsFetchAndMergeRuleParameters) (rule *RepositoryRule) { + if params != nil { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "update", + Parameters: &rawParams, + } + } + return &RepositoryRule{ + Type: "update", + } +} + +// NewDeletionRule creates a rule to only allow users with bypass permissions to delete matching refs. +func NewDeletionRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "deletion", + } +} + +// NewRequiredLinearHistoryRule creates a rule to prevent merge commits from being pushed to matching branches. +func NewRequiredLinearHistoryRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "required_linear_history", + } +} + +// NewRequiredDeploymentsRule creates a rule to require environments to be successfully deployed before they can be merged into the matching branches. +func NewRequiredDeploymentsRule(params *RequiredDeploymentEnvironmentsRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "required_deployments", + Parameters: &rawParams, + } +} + +// NewRequiredSignaturesRule creates a rule a to require commits pushed to matching branches to have verified signatures. +func NewRequiredSignaturesRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "required_signatures", + } +} + +// NewPullRequestRule creates a rule to require all commits be made to a non-target branch and submitted via a pull request before they can be merged. +func NewPullRequestRule(params *PullRequestRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "pull_request", + Parameters: &rawParams, + } +} + +// NewRequiredStatusChecksRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. +func NewRequiredStatusChecksRule(params *RequiredStatusChecksRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "required_status_checks", + Parameters: &rawParams, + } +} + +// NewNonFastForwardRule creates a rule as part to prevent users with push access from force pushing to matching branches. +func NewNonFastForwardRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "non_fast_forward", + } +} + +// NewCommitMessagePatternRule creates a rule to restrict commit message patterns being pushed to matching branches. +func NewCommitMessagePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "commit_message_pattern", + Parameters: &rawParams, + } +} + +// NewCommitAuthorEmailPatternRule creates a rule to restrict commits with author email patterns being merged into matching branches. +func NewCommitAuthorEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "commit_author_email_pattern", + Parameters: &rawParams, + } +} + +// NewCommitterEmailPatternRule creates a rule to restrict commits with committer email patterns being merged into matching branches. +func NewCommitterEmailPatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "committer_email_pattern", + Parameters: &rawParams, + } +} + +// NewBranchNamePatternRule creates a rule to restrict branch patterns from being merged into matching branches. +func NewBranchNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "branch_name_pattern", + Parameters: &rawParams, + } +} + +// NewTagNamePatternRule creates a rule to restrict tag patterns contained in non-target branches from being merged into matching branches. +func NewTagNamePatternRule(params *RulePatternParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "tag_name_pattern", + Parameters: &rawParams, + } +} + +// NewRequiredWorkflowsRule creates a rule to require which status checks must pass before branches can be merged into a branch rule. +func NewRequiredWorkflowsRule(params *RequiredWorkflowsRuleParameters) (rule *RepositoryRule) { + bytes, _ := json.Marshal(params) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "workflows", + Parameters: &rawParams, + } +} + +// 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) + + rawParams := json.RawMessage(bytes) + + return &RepositoryRule{ + Type: "file_path_restriction", + Parameters: &rawParams, + } +} + +// 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, push + Target *string `json:"target,omitempty"` + // Possible values for SourceType are: Repository, Organization + SourceType *string `json:"source_type,omitempty"` + Source string `json:"source"` + // Possible values for Enforcement are: disabled, active, evaluate + Enforcement string `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors,omitempty"` + NodeID *string `json:"node_id,omitempty"` + 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. +type rulesetNoOmitBypassActors struct { + ID *int64 `json:"id,omitempty"` + Name string `json:"name"` + // Possible values for Target are branch, tag + Target *string `json:"target,omitempty"` + // Possible values for SourceType are: Repository, Organization + SourceType *string `json:"source_type,omitempty"` + Source string `json:"source"` + // Possible values for Enforcement are: disabled, active, evaluate + Enforcement string `json:"enforcement"` + BypassActors []*BypassActor `json:"bypass_actors"` + NodeID *string `json:"node_id,omitempty"` + Links *RulesetLinks `json:"_links,omitempty"` + Conditions *RulesetConditions `json:"conditions,omitempty"` + Rules []*RepositoryRule `json:"rules,omitempty"` +} + +// GetRulesForBranch gets all the rules that apply to the specified branch. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch +// +//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch} +func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string) ([]*RepositoryRule, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var rules []*RepositoryRule + resp, err := s.client.Do(ctx, req, &rules) + if err != nil { + return nil, resp, err + } + + return rules, resp, nil +} + +// GetAllRulesets gets all the rules that apply to the specified repository. +// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets +// +//meta:operation GET /repos/{owner}/{repo}/rulesets +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, includesParents bool) ([]*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset []*Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// CreateRuleset creates a ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset +// +//meta:operation POST /repos/{owner}/{repo}/rulesets +func (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + req, err := s.client.NewRequest("POST", u, rs) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// GetRuleset gets a ruleset for the specified repository. +// If includesParents is true, rulesets configured at the organization level that apply to the repository will be returned. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset +// +//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v?includes_parents=%v", owner, repo, rulesetID, includesParents) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRuleset updates a ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest("PUT", u, rs) + if err != nil { + return nil, nil, err + } + + var ruleset *Ruleset + resp, err := s.client.Do(ctx, req, &ruleset) + if err != nil { + return nil, resp, err + } + + return ruleset, resp, nil +} + +// UpdateRulesetNoBypassActor updates a ruleset for the specified repository. +// +// This function is necessary as the UpdateRuleset function does not marshal ByPassActor if passed as nil or an empty array. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset +// +//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) UpdateRulesetNoBypassActor(ctx context.Context, owner, repo string, rulesetID int64, rs *Ruleset) (*Ruleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + rsNoBypassActor := &rulesetNoOmitBypassActors{} + + if rs != nil { + rsNoBypassActor = &rulesetNoOmitBypassActors{ + ID: rs.ID, + Name: rs.Name, + Target: rs.Target, + SourceType: rs.SourceType, + Source: rs.Source, + Enforcement: rs.Enforcement, + BypassActors: rs.BypassActors, + NodeID: rs.NodeID, + Links: rs.Links, + Conditions: rs.Conditions, + Rules: rs.Rules, + } + } + + req, err := s.client.NewRequest("PUT", u, rsNoBypassActor) + if err != nil { + return nil, nil, err + } + + var ruleSet *Ruleset + resp, err := s.client.Do(ctx, req, &ruleSet) + if err != nil { + return nil, resp, err + } + + return ruleSet, resp, nil +} + +// DeleteRuleset deletes a ruleset for the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset +// +//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id} +func (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets/%v", owner, repo, rulesetID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v59/github/repos_stats.go b/vendor/github.com/google/go-github/v67/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_stats.go rename to vendor/github.com/google/go-github/v67/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_statuses.go b/vendor/github.com/google/go-github/v67/github/repos_statuses.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_statuses.go rename to vendor/github.com/google/go-github/v67/github/repos_statuses.go diff --git a/vendor/github.com/google/go-github/v59/github/repos_tags.go b/vendor/github.com/google/go-github/v67/github/repos_tags.go similarity index 62% rename from vendor/github.com/google/go-github/v59/github/repos_tags.go rename to vendor/github.com/google/go-github/v67/github/repos_tags.go index 93164dd..b6dc36e 100644 --- a/vendor/github.com/google/go-github/v59/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v67/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#closing-down---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#closing-down---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#closing-down---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/v59/github/repos_traffic.go b/vendor/github.com/google/go-github/v67/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/repos_traffic.go rename to vendor/github.com/google/go-github/v67/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v59/github/scim.go b/vendor/github.com/google/go-github/v67/github/scim.go similarity index 96% rename from vendor/github.com/google/go-github/v59/github/scim.go rename to vendor/github.com/google/go-github/v67/github/scim.go index 02136d7..4b34c16 100644 --- a/vendor/github.com/google/go-github/v59/github/scim.go +++ b/vendor/github.com/google/go-github/v67/github/scim.go @@ -110,19 +110,21 @@ func (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org str // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user // //meta:operation POST /scim/v2/organizations/{org}/Users -func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*Response, error) { +func (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*SCIMUserAttributes, *Response, error) { u := fmt.Sprintf("scim/v2/organizations/%v/Users", org) - u, err := addOptions(u, opts) + + req, err := s.client.NewRequest("POST", u, opts) if err != nil { - return nil, err + return nil, nil, err } - req, err := s.client.NewRequest("POST", u, nil) + user := new(SCIMUserAttributes) + resp, err := s.client.Do(ctx, req, user) if err != nil { - return nil, err + return nil, resp, err } - return s.client.Do(ctx, req, nil) + return user, resp, nil } // GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user. diff --git a/vendor/github.com/google/go-github/v59/github/search.go b/vendor/github.com/google/go-github/v67/github/search.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/search.go rename to vendor/github.com/google/go-github/v67/github/search.go index 71efe87..54bc6d5 100644 --- a/vendor/github.com/google/go-github/v59/github/search.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/secret_scanning.go b/vendor/github.com/google/go-github/v67/github/secret_scanning.go similarity index 94% rename from vendor/github.com/google/go-github/v59/github/secret_scanning.go rename to vendor/github.com/google/go-github/v67/github/secret_scanning.go index 9b2ad8c..2744926 100644 --- a/vendor/github.com/google/go-github/v59/github/secret_scanning.go +++ b/vendor/github.com/google/go-github/v67/github/secret_scanning.go @@ -44,15 +44,16 @@ type SecretScanningAlertLocation struct { // SecretScanningAlertLocationDetails represents the location details for a secret scanning alert. type SecretScanningAlertLocationDetails struct { - Path *string `json:"path,omitempty"` - Startline *int `json:"start_line,omitempty"` - EndLine *int `json:"end_line,omitempty"` - StartColumn *int `json:"start_column,omitempty"` - EndColumn *int `json:"end_column,omitempty"` - BlobSHA *string `json:"blob_sha,omitempty"` - BlobURL *string `json:"blob_url,omitempty"` - CommitSHA *string `json:"commit_sha,omitempty"` - CommitURL *string `json:"commit_url,omitempty"` + Path *string `json:"path,omitempty"` + Startline *int `json:"start_line,omitempty"` + EndLine *int `json:"end_line,omitempty"` + StartColumn *int `json:"start_column,omitempty"` + EndColumn *int `json:"end_column,omitempty"` + BlobSHA *string `json:"blob_sha,omitempty"` + BlobURL *string `json:"blob_url,omitempty"` + CommitSHA *string `json:"commit_sha,omitempty"` + CommitURL *string `json:"commit_url,omitempty"` + PullRequestCommentURL *string `json:"pull_request_comment_url,omitempty"` } // SecretScanningAlertListOptions specifies optional parameters to the SecretScanningService.ListAlertsForEnterprise method. diff --git a/vendor/github.com/google/go-github/v59/github/security_advisories.go b/vendor/github.com/google/go-github/v67/github/security_advisories.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/security_advisories.go rename to vendor/github.com/google/go-github/v67/github/security_advisories.go diff --git a/vendor/github.com/google/go-github/v59/github/strings.go b/vendor/github.com/google/go-github/v67/github/strings.go similarity index 85% rename from vendor/github.com/google/go-github/v59/github/strings.go rename to vendor/github.com/google/go-github/v67/github/strings.go index 147c515..f5e61aa 100644 --- a/vendor/github.com/google/go-github/v59/github/strings.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/teams.go b/vendor/github.com/google/go-github/v67/github/teams.go similarity index 94% rename from vendor/github.com/google/go-github/v59/github/teams.go rename to vendor/github.com/google/go-github/v67/github/teams.go index fd22b79..df248b6 100644 --- a/vendor/github.com/google/go-github/v59/github/teams.go +++ b/vendor/github.com/google/go-github/v67/github/teams.go @@ -9,7 +9,6 @@ import ( "context" "fmt" "net/http" - "strings" ) // TeamsService provides access to the team-related functions @@ -155,6 +154,9 @@ type NewTeam struct { RepoNames []string `json:"repo_names,omitempty"` ParentTeamID *int64 `json:"parent_team_id,omitempty"` + // NotificationSetting can be one of: "notifications_enabled", "notifications_disabled". + NotificationSetting *string `json:"notification_setting,omitempty"` + // Deprecated: Permission is deprecated when creating or editing a team in an org // using the new GitHub permission model. It no longer identifies the // permission a team has on its repos, but only specifies the default @@ -203,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" @@ -217,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, } } @@ -384,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) @@ -414,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) @@ -440,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) @@ -466,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) @@ -601,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) @@ -627,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) @@ -653,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) @@ -679,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) @@ -718,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) } @@ -739,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) } @@ -763,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) } @@ -787,12 +780,19 @@ 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) } +// ListIDPGroupsOptions specifies the optional parameters to the ListIDPGroupsInOrganization method. +type ListIDPGroupsOptions struct { + // Filters the results to return only those that begin with the value specified by this parameter. + Query string `url:"q,omitempty"` + + ListCursorOptions +} + // IDPGroupList represents a list of external identity provider (IDP) groups. type IDPGroupList struct { Groups []*IDPGroup `json:"groups"` @@ -810,7 +810,7 @@ type IDPGroup struct { // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization // //meta:operation GET /orgs/{org}/team-sync/groups -func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListCursorOptions) (*IDPGroupList, *Response, error) { +func (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) { u := fmt.Sprintf("orgs/%v/team-sync/groups", org) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v59/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v67/github/teams_discussion_comments.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v67/github/teams_discussion_comments.go index ad3818c..eba6fdf 100644 --- a/vendor/github.com/google/go-github/v59/github/teams_discussion_comments.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/teams_discussions.go b/vendor/github.com/google/go-github/v67/github/teams_discussions.go similarity index 99% rename from vendor/github.com/google/go-github/v59/github/teams_discussions.go rename to vendor/github.com/google/go-github/v67/github/teams_discussions.go index ee78c03..b056525 100644 --- a/vendor/github.com/google/go-github/v59/github/teams_discussions.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/teams_members.go b/vendor/github.com/google/go-github/v67/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/teams_members.go rename to vendor/github.com/google/go-github/v67/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v59/github/timestamp.go b/vendor/github.com/google/go-github/v67/github/timestamp.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/timestamp.go rename to vendor/github.com/google/go-github/v67/github/timestamp.go index 00c1235..dc1045c 100644 --- a/vendor/github.com/google/go-github/v59/github/timestamp.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/users.go b/vendor/github.com/google/go-github/v67/github/users.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/users.go rename to vendor/github.com/google/go-github/v67/github/users.go index 51b2b21..c1ab555 100644 --- a/vendor/github.com/google/go-github/v59/github/users.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/users_administration.go b/vendor/github.com/google/go-github/v67/github/users_administration.go similarity index 91% rename from vendor/github.com/google/go-github/v59/github/users_administration.go rename to vendor/github.com/google/go-github/v67/github/users_administration.go index 5b9e1de..c0aa3b6 100644 --- a/vendor/github.com/google/go-github/v59/github/users_administration.go +++ b/vendor/github.com/google/go-github/v67/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.11/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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.11/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.15/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/v67/github/users_attestations.go b/vendor/github.com/google/go-github/v67/github/users_attestations.go new file mode 100644 index 0000000..18f6029 --- /dev/null +++ b/vendor/github.com/google/go-github/v67/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/v59/github/users_blocking.go b/vendor/github.com/google/go-github/v67/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/users_blocking.go rename to vendor/github.com/google/go-github/v67/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v59/github/users_emails.go b/vendor/github.com/google/go-github/v67/github/users_emails.go similarity index 94% rename from vendor/github.com/google/go-github/v59/github/users_emails.go rename to vendor/github.com/google/go-github/v67/github/users_emails.go index 8386de2..3d0e1bf 100644 --- a/vendor/github.com/google/go-github/v59/github/users_emails.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/users_followers.go b/vendor/github.com/google/go-github/v67/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/users_followers.go rename to vendor/github.com/google/go-github/v67/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v59/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v67/github/users_gpg_keys.go similarity index 98% rename from vendor/github.com/google/go-github/v59/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v67/github/users_gpg_keys.go index de7caaf..2f296a1 100644 --- a/vendor/github.com/google/go-github/v59/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/users_keys.go b/vendor/github.com/google/go-github/v67/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/users_keys.go rename to vendor/github.com/google/go-github/v67/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v59/github/users_packages.go b/vendor/github.com/google/go-github/v67/github/users_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/users_packages.go rename to vendor/github.com/google/go-github/v67/github/users_packages.go diff --git a/vendor/github.com/google/go-github/v59/github/users_projects.go b/vendor/github.com/google/go-github/v67/github/users_projects.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/users_projects.go rename to vendor/github.com/google/go-github/v67/github/users_projects.go diff --git a/vendor/github.com/google/go-github/v59/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v67/github/users_ssh_signing_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v59/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v67/github/users_ssh_signing_keys.go diff --git a/vendor/github.com/google/go-github/v59/github/with_appengine.go b/vendor/github.com/google/go-github/v67/github/with_appengine.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/with_appengine.go rename to vendor/github.com/google/go-github/v67/github/with_appengine.go index 9053ce1..9bb95b8 100644 --- a/vendor/github.com/google/go-github/v59/github/with_appengine.go +++ b/vendor/github.com/google/go-github/v67/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/v59/github/without_appengine.go b/vendor/github.com/google/go-github/v67/github/without_appengine.go similarity index 95% rename from vendor/github.com/google/go-github/v59/github/without_appengine.go rename to vendor/github.com/google/go-github/v67/github/without_appengine.go index 0024ae4..bfdb18e 100644 --- a/vendor/github.com/google/go-github/v59/github/without_appengine.go +++ b/vendor/github.com/google/go-github/v67/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 b28fcdf..ad05aa4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,9 +1,9 @@ # github.com/golang/protobuf v1.5.3 ## explicit; go 1.9 github.com/golang/protobuf/proto -# github.com/google/go-github/v59 v59.0.0 -## explicit; go 1.17 -github.com/google/go-github/v59/github +# github.com/google/go-github/v67 v67.0.0 +## explicit; go 1.21 +github.com/google/go-github/v67/github # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query