From 89e174421f5c6af2665fea81e43b459261a00c9f Mon Sep 17 00:00:00 2001 From: "red-hat-konflux[bot]" <126015336+red-hat-konflux[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 18:17:08 +0000 Subject: [PATCH] chore(deps): update module github.com/bradleyfalzon/ghinstallation/v2 to v2.17.0 Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com> --- go.mod | 4 +- go.sum | 8 +- .../ghinstallation/v2/.golangci.yml | 30 +- .../bradleyfalzon/ghinstallation/v2/README.md | 61 +- .../ghinstallation/v2/transport.go | 2 +- .../v69/github/actions_required_workflows.go | 267 -- .../go-github/v69/github/dependency_graph.go | 82 - .../google/go-github/v69/github/packages.go | 143 - .../google/go-github/{v69 => v75}/AUTHORS | 25 + .../google/go-github/{v69 => v75}/LICENSE | 0 .../go-github/{v69 => v75}/github/actions.go | 0 .../{v69 => v75}/github/actions_artifacts.go | 41 +- .../{v69 => v75}/github/actions_cache.go | 0 .../v75/github/actions_hosted_runners.go | 379 +++ .../{v69 => v75}/github/actions_oidc.go | 0 .../github/actions_permissions_enterprise.go | 119 + .../github/actions_permissions_orgs.go | 214 ++ .../github/actions_runner_groups.go | 0 .../{v69 => v75}/github/actions_runners.go | 0 .../{v69 => v75}/github/actions_secrets.go | 25 +- .../{v69 => v75}/github/actions_variables.go | 27 + .../github/actions_workflow_jobs.go | 0 .../github/actions_workflow_runs.go | 3 +- .../{v69 => v75}/github/actions_workflows.go | 22 +- .../go-github/{v69 => v75}/github/activity.go | 0 .../{v69 => v75}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{v69 => v75}/github/activity_star.go | 6 +- .../{v69 => v75}/github/activity_watching.go | 0 .../go-github/{v69 => v75}/github/admin.go | 4 +- .../{v69 => v75}/github/admin_orgs.go | 14 +- .../{v69 => v75}/github/admin_stats.go | 2 +- .../{v69 => v75}/github/admin_users.go | 8 +- .../go-github/{v69 => v75}/github/apps.go | 2 + .../{v69 => v75}/github/apps_hooks.go | 0 .../github/apps_hooks_deliveries.go | 0 .../{v69 => v75}/github/apps_installation.go | 17 - .../{v69 => v75}/github/apps_manifest.go | 0 .../{v69 => v75}/github/apps_marketplace.go | 0 .../{v69 => v75}/github/attestations.go | 0 .../{v69 => v75}/github/authorizations.go | 4 +- .../go-github/{v69 => v75}/github/billing.go | 96 + .../go-github/{v69 => v75}/github/checks.go | 6 +- .../google/go-github/v75/github/classroom.go | 82 + .../{v69 => v75}/github/code_scanning.go | 0 .../{v69 => v75}/github/codesofconduct.go | 0 .../{v69 => v75}/github/codespaces.go | 0 .../{v69 => v75}/github/codespaces_secrets.go | 41 + .../go-github/{v69 => v75}/github/copilot.go | 24 +- .../{v69 => v75}/github/dependabot.go | 0 .../{v69 => v75}/github/dependabot_alerts.go | 10 + .../{v69 => v75}/github/dependabot_secrets.go | 23 + .../go-github/v75/github/dependency_graph.go | 129 + .../github/dependency_graph_snapshots.go | 11 + .../go-github/{v69 => v75}/github/doc.go | 36 +- .../go-github/{v69 => v75}/github/emojis.go | 0 .../{v69 => v75}/github/enterprise.go | 0 .../enterprise_actions_hosted_runners.go | 234 ++ .../enterprise_actions_runner_groups.go | 0 .../github/enterprise_actions_runners.go | 0 .../github/enterprise_audit_log.go | 0 .../enterprise_code_security_and_analysis.go | 0 .../github/enterprise_manage_ghes.go | 8 +- .../github/enterprise_manage_ghes_config.go | 20 +- .../enterprise_manage_ghes_maintenance.go | 4 +- .../github/enterprise_manage_ghes_ssh.go | 6 +- .../enterprise_network_configurations.go | 139 + .../github/enterprise_properties.go | 0 .../{v69 => v75}/github/enterprise_rules.go | 0 .../go-github/{v69 => v75}/github/event.go | 4 +- .../{v69 => v75}/github/event_types.go | 158 +- .../go-github/{v69 => v75}/github/gists.go | 0 .../{v69 => v75}/github/gists_comments.go | 0 .../go-github/{v69 => v75}/github/git.go | 0 .../{v69 => v75}/github/git_blobs.go | 4 +- .../{v69 => v75}/github/git_commits.go | 10 +- .../go-github/{v69 => v75}/github/git_refs.go | 60 +- .../go-github/{v69 => v75}/github/git_tags.go | 31 +- .../{v69 => v75}/github/git_trees.go | 11 +- .../{v69 => v75}/github/github-accessors.go | 2304 ++++++++++++++--- .../go-github/{v69 => v75}/github/github.go | 81 +- .../{v69 => v75}/github/gitignore.go | 0 .../{v69 => v75}/github/interactions.go | 0 .../{v69 => v75}/github/interactions_orgs.go | 0 .../{v69 => v75}/github/interactions_repos.go | 0 .../{v69 => v75}/github/issue_import.go | 0 .../go-github/{v69 => v75}/github/issues.go | 37 +- .../{v69 => v75}/github/issues_assignees.go | 0 .../{v69 => v75}/github/issues_comments.go | 14 +- .../{v69 => v75}/github/issues_events.go | 0 .../{v69 => v75}/github/issues_labels.go | 22 +- .../{v69 => v75}/github/issues_milestones.go | 10 +- .../{v69 => v75}/github/issues_timeline.go | 0 .../go-github/{v69 => v75}/github/licenses.go | 0 .../go-github/{v69 => v75}/github/markdown.go | 0 .../go-github/{v69 => v75}/github/messages.go | 47 +- .../go-github/{v69 => v75}/github/meta.go | 6 +- .../{v69 => v75}/github/migrations.go | 20 +- .../github/migrations_source_import.go | 0 .../{v69 => v75}/github/migrations_user.go | 2 +- .../go-github/{v69 => v75}/github/orgs.go | 18 + .../github/orgs_actions_allowed.go | 0 .../github/orgs_actions_permissions.go | 0 .../{v69 => v75}/github/orgs_attestations.go | 2 +- .../{v69 => v75}/github/orgs_audit_log.go | 12 +- .../orgs_codesecurity_configurations.go | 0 .../github/orgs_credential_authorizations.go | 0 .../github/orgs_custom_repository_roles.go | 0 .../{v69 => v75}/github/orgs_hooks.go | 5 + .../github/orgs_hooks_configuration.go | 0 .../github/orgs_hooks_deliveries.go | 0 .../go-github/v75/github/orgs_issue_types.go | 99 + .../{v69 => v75}/github/orgs_members.go | 0 .../v75/github/orgs_network_configurations.go | 236 ++ .../github/orgs_organization_roles.go | 0 .../github/orgs_outside_collaborators.go | 4 +- .../{v69 => v75}/github/orgs_packages.go | 0 .../github/orgs_personal_access_tokens.go | 5 + .../{v69 => v75}/github/orgs_properties.go | 15 +- .../{v69 => v75}/github/orgs_rules.go | 7 +- .../github/orgs_security_managers.go | 0 .../github/orgs_users_blocking.go | 6 +- .../google/go-github/v75/github/packages.go | 319 +++ .../go-github/{v69 => v75}/github/pulls.go | 76 +- .../{v69 => v75}/github/pulls_comments.go | 4 + .../{v69 => v75}/github/pulls_reviewers.go | 0 .../{v69 => v75}/github/pulls_reviews.go | 6 +- .../{v69 => v75}/github/pulls_threads.go | 0 .../{v69 => v75}/github/rate_limit.go | 0 .../{v69 => v75}/github/reactions.go | 71 +- .../go-github/{v69 => v75}/github/repos.go | 232 +- .../github/repos_actions_access.go | 0 .../github/repos_actions_allowed.go | 0 .../github/repos_actions_permissions.go | 74 + .../{v69 => v75}/github/repos_attestations.go | 2 +- .../{v69 => v75}/github/repos_autolinks.go | 0 .../{v69 => v75}/github/repos_codeowners.go | 0 .../github/repos_collaborators.go | 0 .../{v69 => v75}/github/repos_comments.go | 0 .../{v69 => v75}/github/repos_commits.go | 4 +- .../github/repos_community_health.go | 0 .../{v69 => v75}/github/repos_contents.go | 28 +- .../repos_deployment_branch_policies.go | 0 .../repos_deployment_protection_rules.go | 0 .../{v69 => v75}/github/repos_deployments.go | 20 +- .../{v69 => v75}/github/repos_environments.go | 4 +- .../{v69 => v75}/github/repos_forks.go | 0 .../{v69 => v75}/github/repos_hooks.go | 23 +- .../github/repos_hooks_configuration.go | 0 .../github/repos_hooks_deliveries.go | 23 +- .../{v69 => v75}/github/repos_invitations.go | 0 .../{v69 => v75}/github/repos_keys.go | 8 +- .../{v69 => v75}/github/repos_lfs.go | 0 .../{v69 => v75}/github/repos_merging.go | 0 .../{v69 => v75}/github/repos_pages.go | 33 + .../github/repos_prereceive_hooks.go | 8 +- .../{v69 => v75}/github/repos_properties.go | 0 .../{v69 => v75}/github/repos_releases.go | 15 +- .../{v69 => v75}/github/repos_rules.go | 27 +- .../{v69 => v75}/github/repos_stats.go | 0 .../{v69 => v75}/github/repos_statuses.go | 6 +- .../{v69 => v75}/github/repos_tags.go | 15 +- .../{v69 => v75}/github/repos_traffic.go | 0 .../go-github/{v69 => v75}/github/rules.go | 50 +- .../go-github/{v69 => v75}/github/scim.go | 26 +- .../go-github/{v69 => v75}/github/search.go | 13 +- .../{v69 => v75}/github/secret_scanning.go | 56 +- .../github/secret_scanning_pattern_configs.go | 165 ++ .../github/security_advisories.go | 4 + .../go-github/{v69 => v75}/github/strings.go | 2 +- .../google/go-github/v75/github/sub_issue.go | 140 + .../go-github/{v69 => v75}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{v69 => v75}/github/teams_discussions.go | 0 .../{v69 => v75}/github/teams_members.go | 0 .../{v69 => v75}/github/timestamp.go | 0 .../go-github/{v69 => v75}/github/users.go | 0 .../github/users_administration.go | 8 +- .../{v69 => v75}/github/users_attestations.go | 2 +- .../{v69 => v75}/github/users_blocking.go | 0 .../{v69 => v75}/github/users_emails.go | 0 .../{v69 => v75}/github/users_followers.go | 0 .../{v69 => v75}/github/users_gpg_keys.go | 0 .../{v69 => v75}/github/users_keys.go | 0 .../{v69 => v75}/github/users_packages.go | 5 +- .../v75/github/users_social_accounts.go | 105 + .../github/users_ssh_signing_keys.go | 0 .../{v69 => v75}/github/with_appengine.go | 0 .../{v69 => v75}/github/without_appengine.go | 0 vendor/modules.txt | 10 +- 190 files changed, 5840 insertions(+), 1352 deletions(-) delete mode 100644 vendor/github.com/google/go-github/v69/github/actions_required_workflows.go delete mode 100644 vendor/github.com/google/go-github/v69/github/dependency_graph.go delete mode 100644 vendor/github.com/google/go-github/v69/github/packages.go rename vendor/github.com/google/go-github/{v69 => v75}/AUTHORS (95%) rename vendor/github.com/google/go-github/{v69 => v75}/LICENSE (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_artifacts.go (81%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_cache.go (100%) create mode 100644 vendor/github.com/google/go-github/v75/github/actions_hosted_runners.go rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_oidc.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_permissions_enterprise.go (64%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_permissions_orgs.go (51%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_runner_groups.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_runners.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_secrets.go (97%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_variables.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_workflow_jobs.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_workflow_runs.go (99%) rename vendor/github.com/google/go-github/{v69 => v75}/github/actions_workflows.go (89%) rename vendor/github.com/google/go-github/{v69 => v75}/github/activity.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/activity_events.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/activity_notifications.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/activity_star.go (94%) rename vendor/github.com/google/go-github/{v69 => v75}/github/activity_watching.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/admin.go (97%) rename vendor/github.com/google/go-github/{v69 => v75}/github/admin_orgs.go (88%) rename vendor/github.com/google/go-github/{v69 => v75}/github/admin_stats.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/admin_users.go (94%) rename vendor/github.com/google/go-github/{v69 => v75}/github/apps.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/apps_hooks.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/apps_hooks_deliveries.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/apps_installation.go (87%) rename vendor/github.com/google/go-github/{v69 => v75}/github/apps_manifest.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/apps_marketplace.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/attestations.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/authorizations.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/billing.go (69%) rename vendor/github.com/google/go-github/{v69 => v75}/github/checks.go (97%) create mode 100644 vendor/github.com/google/go-github/v75/github/classroom.go rename vendor/github.com/google/go-github/{v69 => v75}/github/code_scanning.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/codesofconduct.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/codespaces.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/codespaces_secrets.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/copilot.go (95%) rename vendor/github.com/google/go-github/{v69 => v75}/github/dependabot.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/dependabot_alerts.go (94%) rename vendor/github.com/google/go-github/{v69 => v75}/github/dependabot_secrets.go (95%) create mode 100644 vendor/github.com/google/go-github/v75/github/dependency_graph.go rename vendor/github.com/google/go-github/{v69 => v75}/github/dependency_graph_snapshots.go (89%) rename vendor/github.com/google/go-github/{v69 => v75}/github/doc.go (85%) rename vendor/github.com/google/go-github/{v69 => v75}/github/emojis.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise.go (100%) create mode 100644 vendor/github.com/google/go-github/v75/github/enterprise_actions_hosted_runners.go rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_actions_runner_groups.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_actions_runners.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_audit_log.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_code_security_and_analysis.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_manage_ghes.go (95%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_manage_ghes_config.go (97%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_manage_ghes_maintenance.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_manage_ghes_ssh.go (93%) create mode 100644 vendor/github.com/google/go-github/v75/github/enterprise_network_configurations.go rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_properties.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/enterprise_rules.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/event.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/event_types.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/gists.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/gists_comments.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/git.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/git_blobs.go (90%) rename vendor/github.com/google/go-github/{v69 => v75}/github/git_commits.go (94%) rename vendor/github.com/google/go-github/{v69 => v75}/github/git_refs.go (71%) rename vendor/github.com/google/go-github/{v69 => v75}/github/git_tags.go (63%) rename vendor/github.com/google/go-github/{v69 => v75}/github/git_trees.go (90%) rename vendor/github.com/google/go-github/{v69 => v75}/github/github-accessors.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/github.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/gitignore.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/interactions.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/interactions_orgs.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/interactions_repos.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issue_import.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues.go (87%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues_assignees.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues_comments.go (86%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues_events.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues_labels.go (85%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues_milestones.go (91%) rename vendor/github.com/google/go-github/{v69 => v75}/github/issues_timeline.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/licenses.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/markdown.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/messages.go (92%) rename vendor/github.com/google/go-github/{v69 => v75}/github/meta.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/migrations.go (89%) rename vendor/github.com/google/go-github/{v69 => v75}/github/migrations_source_import.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/migrations_user.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs.go (88%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_actions_permissions.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_attestations.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_audit_log.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_codesecurity_configurations.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_credential_authorizations.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_custom_repository_roles.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_hooks.go (97%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_hooks_configuration.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_hooks_deliveries.go (100%) create mode 100644 vendor/github.com/google/go-github/v75/github/orgs_issue_types.go rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_members.go (100%) create mode 100644 vendor/github.com/google/go-github/v75/github/orgs_network_configurations.go rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_organization_roles.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_outside_collaborators.go (95%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_packages.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_personal_access_tokens.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_properties.go (94%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_rules.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_security_managers.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/orgs_users_blocking.go (95%) create mode 100644 vendor/github.com/google/go-github/v75/github/packages.go rename vendor/github.com/google/go-github/{v69 => v75}/github/pulls.go (84%) rename vendor/github.com/google/go-github/{v69 => v75}/github/pulls_comments.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/pulls_reviewers.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/pulls_reviews.go (96%) rename vendor/github.com/google/go-github/{v69 => v75}/github/pulls_threads.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/rate_limit.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/reactions.go (89%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos.go (90%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_actions_access.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_actions_allowed.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_actions_permissions.go (58%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_attestations.go (92%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_autolinks.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_codeowners.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_collaborators.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_comments.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_commits.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_community_health.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_contents.go (94%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_deployment_branch_policies.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_deployment_protection_rules.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_deployments.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_environments.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_forks.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_hooks.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_hooks_configuration.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_hooks_deliveries.go (88%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_invitations.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_keys.go (88%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_lfs.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_merging.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_pages.go (90%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_prereceive_hooks.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_properties.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_releases.go (97%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_rules.go (88%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_stats.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_statuses.go (95%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_tags.go (73%) rename vendor/github.com/google/go-github/{v69 => v75}/github/repos_traffic.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/rules.go (95%) rename vendor/github.com/google/go-github/{v69 => v75}/github/scim.go (89%) rename vendor/github.com/google/go-github/{v69 => v75}/github/search.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/secret_scanning.go (72%) create mode 100644 vendor/github.com/google/go-github/v75/github/secret_scanning_pattern_configs.go rename vendor/github.com/google/go-github/{v69 => v75}/github/security_advisories.go (98%) rename vendor/github.com/google/go-github/{v69 => v75}/github/strings.go (97%) create mode 100644 vendor/github.com/google/go-github/v75/github/sub_issue.go rename vendor/github.com/google/go-github/{v69 => v75}/github/teams.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/teams_discussion_comments.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/teams_discussions.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/teams_members.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/timestamp.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_administration.go (91%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_attestations.go (93%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_blocking.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_emails.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_followers.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_gpg_keys.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_keys.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/users_packages.go (98%) create mode 100644 vendor/github.com/google/go-github/v75/github/users_social_accounts.go rename vendor/github.com/google/go-github/{v69 => v75}/github/users_ssh_signing_keys.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/with_appengine.go (100%) rename vendor/github.com/google/go-github/{v69 => v75}/github/without_appengine.go (100%) diff --git a/go.mod b/go.mod index 1742b3e9e..4c0049c22 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/bombsimon/logrusr/v4 v4.1.0 // indirect - github.com/bradleyfalzon/ghinstallation/v2 v2.14.0 // indirect + github.com/bradleyfalzon/ghinstallation/v2 v2.17.0 // indirect github.com/casbin/casbin/v2 v2.103.0 // indirect github.com/casbin/govaluate v1.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -88,7 +88,7 @@ require ( github.com/google/gnostic-models v0.6.9 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/go-github/v66 v66.0.0 // indirect - github.com/google/go-github/v69 v69.2.0 // indirect + github.com/google/go-github/v75 v75.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/pprof v0.0.0-20250923004556-9e5a51aed1e8 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect diff --git a/go.sum b/go.sum index d294fb578..681eed250 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4Yn github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bombsimon/logrusr/v4 v4.1.0 h1:uZNPbwusB0eUXlO8hIUwStE6Lr5bLN6IgYgG+75kuh4= github.com/bombsimon/logrusr/v4 v4.1.0/go.mod h1:pjfHC5e59CvjTBIU3V3sGhFWFAnsnhOR03TRc6im0l8= -github.com/bradleyfalzon/ghinstallation/v2 v2.14.0 h1:0D4vKCHOvYrDU8u61TnE2JfNT4VRrBLphmxtqazTO+M= -github.com/bradleyfalzon/ghinstallation/v2 v2.14.0/go.mod h1:LOVmdZYVZ8jqdr4n9wWm1ocDiMz9IfMGfRkaYC1a52A= +github.com/bradleyfalzon/ghinstallation/v2 v2.17.0 h1:SmbUK/GxpAspRjSQbB6ARvH+ArzlNzTtHydNyXUQ6zg= +github.com/bradleyfalzon/ghinstallation/v2 v2.17.0/go.mod h1:vuD/xvJT9Y+ZVZRv4HQ42cMyPFIYqpc7AbB4Gvt/DlY= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= @@ -202,8 +202,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= -github.com/google/go-github/v69 v69.2.0 h1:wR+Wi/fN2zdUx9YxSmYE0ktiX9IAR/BeePzeaUUbEHE= -github.com/google/go-github/v69 v69.2.0/go.mod h1:xne4jymxLR6Uj9b7J7PyTpkMYstEMMwGZa0Aehh1azM= +github.com/google/go-github/v75 v75.0.0 h1:k7q8Bvg+W5KxRl9Tjq16a9XEgVY1pwuiG5sIL7435Ic= +github.com/google/go-github/v75 v75.0.0/go.mod h1:H3LUJEA1TCrzuUqtdAQniBNwuKiQIqdGKgBo1/M/uqI= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= diff --git a/vendor/github.com/bradleyfalzon/ghinstallation/v2/.golangci.yml b/vendor/github.com/bradleyfalzon/ghinstallation/v2/.golangci.yml index cab02f84e..44bb8765f 100644 --- a/vendor/github.com/bradleyfalzon/ghinstallation/v2/.golangci.yml +++ b/vendor/github.com/bradleyfalzon/ghinstallation/v2/.golangci.yml @@ -1,16 +1,11 @@ -run: - timeout: 10m - +version: "2" linters: - disable-all: true + default: none enable: - errcheck - gocritic - gocyclo - - gofmt - - goimports - gosec - - gosimple - govet - ineffassign - misspell @@ -19,3 +14,24 @@ linters: - staticcheck - unconvert - unused + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md b/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md index cf5ea50b0..24f9619ff 100644 --- a/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md +++ b/vendor/github.com/bradleyfalzon/ghinstallation/v2/README.md @@ -1,6 +1,6 @@ # ghinstallation -[![GoDoc](https://godoc.org/github.com/bradleyfalzon/ghinstallation?status.svg)](https://godoc.org/github.com/bradleyfalzon/ghinstallation/v2) +[![Go Reference](https://pkg.go.dev/badge/github.com/bradleyfalzon/ghinstallation/v2.svg)](https://pkg.go.dev/github.com/bradleyfalzon/ghinstallation/v2) `ghinstallation` provides `Transport`, which implements `http.RoundTripper` to provide authentication as an installation for GitHub Apps. @@ -8,40 +8,39 @@ provide authentication as an installation for GitHub Apps. This library is designed to provide automatic authentication for https://github.com/google/go-github or your own HTTP client. -See -https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/ +See https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app -# Installation +## Installation Get the package: ```bash -GO111MODULE=on go get -u github.com/bradleyfalzon/ghinstallation/v2 +go get -u github.com/bradleyfalzon/ghinstallation/v2 ``` -# GitHub Example +## GitHub Example ```go import "github.com/bradleyfalzon/ghinstallation/v2" func main() { - // Shared transport to reuse TCP connections. - tr := http.DefaultTransport + // Shared transport to reuse TCP connections. + tr := http.DefaultTransport - // Wrap the shared transport for use with the app ID 1 authenticating with installation ID 99. - itr, err := ghinstallation.NewKeyFromFile(tr, 1, 99, "2016-10-19.private-key.pem") - if err != nil { - log.Fatal(err) - } + // Wrap the shared transport for use with the app ID 1 authenticating with installation ID 99. + itr, err := ghinstallation.NewKeyFromFile(tr, 1, 99, "2016-10-19.private-key.pem") + if err != nil { + log.Fatal(err) + } - // Use installation transport with github.com/google/go-github - client := github.NewClient(&http.Client{Transport: itr}) + // Use installation transport with github.com/google/go-github + client := github.NewClient(&http.Client{Transport: itr}) } ``` You can also use [`New()`](https://pkg.go.dev/github.com/bradleyfalzon/ghinstallation/v2#New) to load a key directly from a `[]byte`. -# GitHub Enterprise Example +## GitHub Enterprise Example For clients using GitHub Enterprise, set the base URL as follows: @@ -51,18 +50,18 @@ import "github.com/bradleyfalzon/ghinstallation/v2" const GitHubEnterpriseURL = "https://github.example.com/api/v3" func main() { - // Shared transport to reuse TCP connections. - tr := http.DefaultTransport - - // Wrap the shared transport for use with the app ID 1 authenticating with installation ID 99. - itr, err := ghinstallation.NewKeyFromFile(tr, 1, 99, "2016-10-19.private-key.pem") - if err != nil { - log.Fatal(err) - } - itr.BaseURL = GitHubEnterpriseURL - - // Use installation transport with github.com/google/go-github - client := github.NewEnterpriseClient(GitHubEnterpriseURL, GitHubEnterpriseURL, &http.Client{Transport: itr}) + // Shared transport to reuse TCP connections. + tr := http.DefaultTransport + + // Wrap the shared transport for use with the app ID 1 authenticating with installation ID 99. + itr, err := ghinstallation.NewKeyFromFile(tr, 1, 99, "2016-10-19.private-key.pem") + if err != nil { + log.Fatal(err) + } + itr.BaseURL = GitHubEnterpriseURL + + // Use installation transport with github.com/google/go-github + client := github.NewEnterpriseClient(GitHubEnterpriseURL, GitHubEnterpriseURL, &http.Client{Transport: itr}) } ``` @@ -85,7 +84,7 @@ WebHook request } ``` -# Customizing signing behavior +## Customizing signing behavior Users can customize signing behavior by passing in a [Signer](https://pkg.go.dev/github.com/bradleyfalzon/ghinstallation/v2#Signer) @@ -101,10 +100,10 @@ atr := NewAppsTransportWithOptions(http.DefaultTransport, 1, WithSigner(signer)) tr := NewFromAppsTransport(atr, 99) ``` -# License +## License [Apache 2.0](LICENSE) -# Dependencies +## Dependencies - [github.com/golang-jwt/jwt-go](https://github.com/golang-jwt/jwt-go) diff --git a/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go b/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go index 854846819..3bd2fec03 100644 --- a/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go +++ b/vendor/github.com/bradleyfalzon/ghinstallation/v2/transport.go @@ -13,7 +13,7 @@ import ( "sync" "time" - "github.com/google/go-github/v69/github" + "github.com/google/go-github/v75/github" ) const ( diff --git a/vendor/github.com/google/go-github/v69/github/actions_required_workflows.go b/vendor/github.com/google/go-github/v69/github/actions_required_workflows.go deleted file mode 100644 index b89741a82..000000000 --- a/vendor/github.com/google/go-github/v69/github/actions_required_workflows.go +++ /dev/null @@ -1,267 +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" -) - -// OrgRequiredWorkflow represents a required workflow object at the org level. -type OrgRequiredWorkflow struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Scope *string `json:"scope,omitempty"` - Ref *string `json:"ref,omitempty"` - State *string `json:"state,omitempty"` - SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Repository *Repository `json:"repository,omitempty"` -} - -// OrgRequiredWorkflows represents the required workflows for the org. -type OrgRequiredWorkflows struct { - TotalCount *int `json:"total_count,omitempty"` - RequiredWorkflows []*OrgRequiredWorkflow `json:"required_workflows,omitempty"` -} - -// CreateUpdateRequiredWorkflowOptions represents the input object used to create or update required workflows. -type CreateUpdateRequiredWorkflowOptions struct { - WorkflowFilePath *string `json:"workflow_file_path,omitempty"` - RepositoryID *int64 `json:"repository_id,omitempty"` - Scope *string `json:"scope,omitempty"` - SelectedRepositoryIDs *SelectedRepoIDs `json:"selected_repository_ids,omitempty"` -} - -// RequiredWorkflowSelectedRepos represents the repos that a required workflow is applied to. -type RequiredWorkflowSelectedRepos struct { - TotalCount *int `json:"total_count,omitempty"` - Repositories []*Repository `json:"repositories,omitempty"` -} - -// RepoRequiredWorkflow represents a required workflow object at the repo level. -type RepoRequiredWorkflow struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - State *string `json:"state,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - BadgeURL *string `json:"badge_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - SourceRepository *Repository `json:"source_repository,omitempty"` -} - -// RepoRequiredWorkflows represents the required workflows for a repo. -type RepoRequiredWorkflows struct { - TotalCount *int `json:"total_count,omitempty"` - RequiredWorkflows []*RepoRequiredWorkflow `json:"required_workflows,omitempty"` -} - -// ListOrgRequiredWorkflows lists the RequiredWorkflows for an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows -func (s *ActionsService) ListOrgRequiredWorkflows(ctx context.Context, org string, opts *ListOptions) (*OrgRequiredWorkflows, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflows := new(OrgRequiredWorkflows) - resp, err := s.client.Do(ctx, req, &requiredWorkflows) - if err != nil { - return nil, resp, err - } - - return requiredWorkflows, resp, nil -} - -// CreateRequiredWorkflow creates the required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation POST /orgs/{org}/actions/required_workflows -func (s *ActionsService) CreateRequiredWorkflow(ctx context.Context, org string, createRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows", org) - req, err := s.client.NewRequest("POST", url, createRequiredWorkflowOptions) - if err != nil { - return nil, nil, err - } - - orgRequiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) - if err != nil { - return nil, resp, err - } - - return orgRequiredWorkflow, resp, nil -} - -// GetRequiredWorkflowByID get the RequiredWorkflows for an org by its ID. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) GetRequiredWorkflowByID(ctx context.Context, owner string, requiredWorkflowID int64) (*OrgRequiredWorkflow, *Response, error) { - u := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", owner, requiredWorkflowID) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, &requiredWorkflow) - if err != nil { - return nil, resp, err - } - - return requiredWorkflow, resp, nil -} - -// UpdateRequiredWorkflow updates a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PATCH /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) UpdateRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64, updateRequiredWorkflowOptions *CreateUpdateRequiredWorkflowOptions) (*OrgRequiredWorkflow, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) - req, err := s.client.NewRequest("PATCH", url, updateRequiredWorkflowOptions) - if err != nil { - return nil, nil, err - } - - orgRequiredWorkflow := new(OrgRequiredWorkflow) - resp, err := s.client.Do(ctx, req, orgRequiredWorkflow) - if err != nil { - return nil, resp, err - } - - return orgRequiredWorkflow, resp, nil -} - -// DeleteRequiredWorkflow deletes a required workflow in an org. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id} -func (s *ActionsService) DeleteRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v", org, requiredWorkflowID) - req, err := s.client.NewRequest("DELETE", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// ListRequiredWorkflowSelectedRepos lists the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /orgs/{org}/actions/required_workflows/{workflow_id}/repositories -func (s *ActionsService) ListRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, opts *ListOptions) (*RequiredWorkflowSelectedRepos, *Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflowRepos := new(RequiredWorkflowSelectedRepos) - resp, err := s.client.Do(ctx, req, &requiredWorkflowRepos) - if err != nil { - return nil, resp, err - } - - return requiredWorkflowRepos, resp, nil -} - -// SetRequiredWorkflowSelectedRepos sets the Repositories selected for a workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories -func (s *ActionsService) SetRequiredWorkflowSelectedRepos(ctx context.Context, org string, requiredWorkflowID int64, ids SelectedRepoIDs) (*Response, error) { - type repoIDs struct { - SelectedIDs SelectedRepoIDs `json:"selected_repository_ids"` - } - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories", org, requiredWorkflowID) - req, err := s.client.NewRequest("PUT", url, repoIDs{SelectedIDs: ids}) - if err != nil { - return nil, err - } - - return s.client.Do(ctx, req, nil) -} - -// AddRepoToRequiredWorkflow adds the Repository to a required workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation PUT /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} -func (s *ActionsService) AddRepoToRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) - req, err := s.client.NewRequest("PUT", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// RemoveRepoFromRequiredWorkflow removes the Repository from a required workflow. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation DELETE /orgs/{org}/actions/required_workflows/{workflow_id}/repositories/{repository_id} -func (s *ActionsService) RemoveRepoFromRequiredWorkflow(ctx context.Context, org string, requiredWorkflowID, repoID int64) (*Response, error) { - url := fmt.Sprintf("orgs/%v/actions/required_workflows/%v/repositories/%v", org, requiredWorkflowID, repoID) - req, err := s.client.NewRequest("DELETE", url, nil) - if err != nil { - return nil, err - } - return s.client.Do(ctx, req, nil) -} - -// ListRepoRequiredWorkflows lists the RequiredWorkflows for a repo. -// -// GitHub API docs: https://docs.github.com/actions/using-workflows/required-workflows -// -//meta:operation GET /repos/{owner}/{repo}/actions/required_workflows -func (s *ActionsService) ListRepoRequiredWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*RepoRequiredWorkflows, *Response, error) { - url := fmt.Sprintf("repos/%v/%v/actions/required_workflows", owner, repo) - u, err := addOptions(url, opts) - if err != nil { - return nil, nil, err - } - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - requiredWorkflows := new(RepoRequiredWorkflows) - resp, err := s.client.Do(ctx, req, &requiredWorkflows) - if err != nil { - return nil, resp, err - } - - return requiredWorkflows, resp, nil -} diff --git a/vendor/github.com/google/go-github/v69/github/dependency_graph.go b/vendor/github.com/google/go-github/v69/github/dependency_graph.go deleted file mode 100644 index 86a1fe48b..000000000 --- a/vendor/github.com/google/go-github/v69/github/dependency_graph.go +++ /dev/null @@ -1,82 +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" -) - -type DependencyGraphService service - -// SBOM represents a software bill of materials, which describes the -// packages/libraries that a repository depends on. -type SBOM struct { - SBOM *SBOMInfo `json:"sbom,omitempty"` -} - -// CreationInfo represents when the SBOM was created and who created it. -type CreationInfo struct { - Created *Timestamp `json:"created,omitempty"` - Creators []string `json:"creators,omitempty"` -} - -// RepoDependencies represents the dependencies of a repo. -type RepoDependencies struct { - SPDXID *string `json:"SPDXID,omitempty"` - // Package name - Name *string `json:"name,omitempty"` - VersionInfo *string `json:"versionInfo,omitempty"` - DownloadLocation *string `json:"downloadLocation,omitempty"` - FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` - LicenseConcluded *string `json:"licenseConcluded,omitempty"` - LicenseDeclared *string `json:"licenseDeclared,omitempty"` -} - -// SBOMInfo represents a software bill of materials (SBOM) using SPDX. -// SPDX is an open standard for SBOMs that -// identifies and catalogs components, licenses, copyrights, security -// references, and other metadata relating to software. -type SBOMInfo struct { - SPDXID *string `json:"SPDXID,omitempty"` - SPDXVersion *string `json:"spdxVersion,omitempty"` - CreationInfo *CreationInfo `json:"creationInfo,omitempty"` - - // Repo name - Name *string `json:"name,omitempty"` - DataLicense *string `json:"dataLicense,omitempty"` - DocumentDescribes []string `json:"documentDescribes,omitempty"` - DocumentNamespace *string `json:"documentNamespace,omitempty"` - - // List of packages dependencies - Packages []*RepoDependencies `json:"packages,omitempty"` -} - -func (s SBOM) String() string { - return Stringify(s) -} - -// GetSBOM fetches the software bill of materials for a repository. -// -// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository -// -//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom -func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) - - req, err := s.client.NewRequest("GET", u, nil) - if err != nil { - return nil, nil, err - } - - var sbom *SBOM - resp, err := s.client.Do(ctx, req, &sbom) - if err != nil { - return nil, resp, err - } - - return sbom, resp, nil -} diff --git a/vendor/github.com/google/go-github/v69/github/packages.go b/vendor/github.com/google/go-github/v69/github/packages.go deleted file mode 100644 index ef7df0740..000000000 --- a/vendor/github.com/google/go-github/v69/github/packages.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2020 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 - -// Package represents a GitHub package. -type Package struct { - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PackageType *string `json:"package_type,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - Owner *User `json:"owner,omitempty"` - PackageVersion *PackageVersion `json:"package_version,omitempty"` - Registry *PackageRegistry `json:"registry,omitempty"` - URL *string `json:"url,omitempty"` - VersionCount *int64 `json:"version_count,omitempty"` - Visibility *string `json:"visibility,omitempty"` - Repository *Repository `json:"repository,omitempty"` -} - -func (p Package) String() string { - return Stringify(p) -} - -// PackageVersion represents a GitHub package version. -type PackageVersion struct { - ID *int64 `json:"id,omitempty"` - Version *string `json:"version,omitempty"` - Summary *string `json:"summary,omitempty"` - Body *string `json:"body,omitempty"` - BodyHTML *string `json:"body_html,omitempty"` - Release *PackageRelease `json:"release,omitempty"` - Manifest *string `json:"manifest,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - TargetOID *string `json:"target_oid,omitempty"` - Draft *bool `json:"draft,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PackageFiles []*PackageFile `json:"package_files,omitempty"` - Author *User `json:"author,omitempty"` - InstallationCommand *string `json:"installation_command,omitempty"` - Metadata *PackageMetadata `json:"metadata,omitempty"` - PackageHTMLURL *string `json:"package_html_url,omitempty"` - Name *string `json:"name,omitempty"` - URL *string `json:"url,omitempty"` -} - -func (pv PackageVersion) String() string { - return Stringify(pv) -} - -// PackageRelease represents a GitHub package version release. -type PackageRelease struct { - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - ID *int64 `json:"id,omitempty"` - TagName *string `json:"tag_name,omitempty"` - TargetCommitish *string `json:"target_commitish,omitempty"` - Name *string `json:"name,omitempty"` - Draft *bool `json:"draft,omitempty"` - Author *User `json:"author,omitempty"` - Prerelease *bool `json:"prerelease,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - PublishedAt *Timestamp `json:"published_at,omitempty"` -} - -func (r PackageRelease) String() string { - return Stringify(r) -} - -// PackageFile represents a GitHub package version release file. -type PackageFile struct { - DownloadURL *string `json:"download_url,omitempty"` - ID *int64 `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SHA256 *string `json:"sha256,omitempty"` - SHA1 *string `json:"sha1,omitempty"` - MD5 *string `json:"md5,omitempty"` - ContentType *string `json:"content_type,omitempty"` - State *string `json:"state,omitempty"` - Author *User `json:"author,omitempty"` - Size *int64 `json:"size,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` -} - -func (pf PackageFile) String() string { - return Stringify(pf) -} - -// PackageRegistry represents a GitHub package registry. -type PackageRegistry struct { - AboutURL *string `json:"about_url,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` - URL *string `json:"url,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} - -func (r PackageRegistry) String() string { - return Stringify(r) -} - -// PackageListOptions represents the optional list options for a package. -type PackageListOptions struct { - // Visibility of packages "public", "internal" or "private". - Visibility *string `url:"visibility,omitempty"` - - // PackageType represents the type of package. - // It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container". - PackageType *string `url:"package_type,omitempty"` - - // State of package either "active" or "deleted". - State *string `url:"state,omitempty"` - - ListOptions -} - -// PackageMetadata represents metadata from a package. -type PackageMetadata struct { - PackageType *string `json:"package_type,omitempty"` - Container *PackageContainerMetadata `json:"container,omitempty"` -} - -func (r PackageMetadata) String() string { - return Stringify(r) -} - -// PackageContainerMetadata represents container metadata for docker container packages. -type PackageContainerMetadata struct { - Tags []string `json:"tags,omitempty"` -} - -func (r PackageContainerMetadata) String() string { - return Stringify(r) -} diff --git a/vendor/github.com/google/go-github/v69/AUTHORS b/vendor/github.com/google/go-github/v75/AUTHORS similarity index 95% rename from vendor/github.com/google/go-github/v69/AUTHORS rename to vendor/github.com/google/go-github/v75/AUTHORS index a6104ffa9..bf789bef0 100644 --- a/vendor/github.com/google/go-github/v69/AUTHORS +++ b/vendor/github.com/google/go-github/v75/AUTHORS @@ -18,7 +18,9 @@ Abhinav Gupta abhishek Abhishek Sharma Abhishek Veeramalla +Abinand P aboy +Adam Guthrie Adam Kohring Aditya Mahendrakar adrienzieba @@ -46,10 +48,12 @@ Ali Farooq Alin Balutoiu Allan Guwatudde Allen Sun +Aman Verma Amey Sakhadeo Anders Janmyr Andreas Deininger Andreas Garnæs +Andreas Jaggi Andrew Gillis Andrew Ryabchun Andrew Svoboda @@ -110,6 +114,7 @@ Carlos Tadeu Panato Junior Casey ChandanChainani chandresh-pancholi +Changyong Um Charles Fenwick Elliott Charlie Yan Chmouel Boudjnah @@ -126,6 +131,7 @@ Christoph Jerolimov Christoph Sassenberg CI Monk Clemens W +Colby Williams Colin Misare Craig Gumbley Craig Peterson @@ -178,6 +184,7 @@ Erwan Finot erwinvaneyk Evan Anderson Evan Elias +Eyal Kapon Fabian Holler Fabrice Fatema-Moaiyadi @@ -214,6 +221,7 @@ haya14busa haya14busa Henrik Lundström Hiroki Ito +hnkƶ Hubot Jr Huy Tr huydx @@ -239,7 +247,9 @@ James Turley Jamie West Jan Guth Jan Kosecki +Jan Niklas Dittmar Jan Švábík +Jason Brill Jason Field Javier Campanini Jef LeCompte @@ -264,6 +274,7 @@ Jordan Sussman Jorge Ferrero Jorge Gómez Reus Joshua Bezaleel Abednego +Joshua French João Cerqueira JP Phillips jpbelanger-mtl @@ -321,6 +332,7 @@ Léo Salé M. Ryan Rigdon Magnus Kulke Maksim Zhylinski +Manuel Bergler Marc Binder Marcelo Carlos Mark Tareshawty @@ -349,6 +361,7 @@ Michael Tiller Michał Glapa Michelangelo Morrillo Miguel Elias dos Santos +Mike Ball Mike Chen Miles Crabill Mishin Nikolai @@ -399,6 +412,8 @@ Patrick Marabeas Patrik Nordlén Pavel Dvoinos Pavel Shtanko +Pavlos Tzianos +Pedja Muatovic Pete Wagner Petr Shevtsov Pierce McEntagart @@ -415,6 +430,7 @@ Rackspace US, Inc. Radek Simko Radliński Ignacy Rafael Aramizu Gomes +Raisa Kabir Rajat Jindal Rajendra arora Rajkumar @@ -435,12 +451,14 @@ Richard de Vries Rob Figueiredo Rohit Upadhyay Rojan Dinc +Roman Wu Roming22 Ronak Jain Ronan Pelliard Ross Gustafson Ruben Vereecken Rufina Talalaeva +Rupok Ghosh Russell Boley Ryan Leung Ryan Lower @@ -455,6 +473,7 @@ Sam Minnée Sandeep Sukhani Sander Knape Sander van Harmelen +sanjay s Sanket Payghan Sarah Funkhouser Sarasa Kisaragi @@ -462,6 +481,7 @@ Sasha Melentyev Sean Wang Sebastian Mandrean Sebastian Mæland Pedersen +sellskin Sergei Popinevskii Sergey Romanov Sergio Garcia @@ -474,6 +494,7 @@ Shawn Smith Shibasis Patel Sho Okada Shrikrishna Singh +Silas Alberti Simon Davis sona-tar soniachikh @@ -500,12 +521,14 @@ Theo Henson Theofilos Petsios Thomas Aidan Curran Thomas Bruyelle +Tim Tim Rogers Timothy O'Brien Timothée Peignier Tingluo Huang tkhandel Tobias Gesellchen +Tom Bamford Tom Payne Tomasz Adam Skrzypczak tomfeigin @@ -520,6 +543,7 @@ Victor Vrantchan Victory Osikwemhe vikkyomkar Vivek +Vivek Kumar Sahu Vlad Ungureanu Wasim Thabraze Weslei Juan Moser Pereira @@ -543,6 +567,7 @@ Yusuke Kuoka Zach Latta Ze Peng zhouhaibing089 +zyfy29 六开箱 缘生 蒋航 diff --git a/vendor/github.com/google/go-github/v69/LICENSE b/vendor/github.com/google/go-github/v75/LICENSE similarity index 100% rename from vendor/github.com/google/go-github/v69/LICENSE rename to vendor/github.com/google/go-github/v75/LICENSE diff --git a/vendor/github.com/google/go-github/v69/github/actions.go b/vendor/github.com/google/go-github/v75/github/actions.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/actions.go rename to vendor/github.com/google/go-github/v75/github/actions.go diff --git a/vendor/github.com/google/go-github/v69/github/actions_artifacts.go b/vendor/github.com/google/go-github/v75/github/actions_artifacts.go similarity index 81% rename from vendor/github.com/google/go-github/v69/github/actions_artifacts.go rename to vendor/github.com/google/go-github/v75/github/actions_artifacts.go index 2b560fa05..4185a1503 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_artifacts.go +++ b/vendor/github.com/google/go-github/v75/github/actions_artifacts.go @@ -29,17 +29,21 @@ type ArtifactWorkflowRun struct { // // GitHub API docs: https://docs.github.com/rest/actions/artifacts type Artifact struct { - ID *int64 `json:"id,omitempty"` - NodeID *string `json:"node_id,omitempty"` - Name *string `json:"name,omitempty"` - SizeInBytes *int64 `json:"size_in_bytes,omitempty"` - URL *string `json:"url,omitempty"` - ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` - Expired *bool `json:"expired,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ExpiresAt *Timestamp `json:"expires_at,omitempty"` - WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + Name *string `json:"name,omitempty"` + SizeInBytes *int64 `json:"size_in_bytes,omitempty"` + URL *string `json:"url,omitempty"` + ArchiveDownloadURL *string `json:"archive_download_url,omitempty"` + Expired *bool `json:"expired,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ExpiresAt *Timestamp `json:"expires_at,omitempty"` + // Digest is the SHA256 digest of the artifact. + // This field will only be populated on artifacts uploaded with upload-artifact v4 or newer. + // For older versions, this field will be null. + Digest *string `json:"digest,omitempty"` + WorkflowRun *ArtifactWorkflowRun `json:"workflow_run,omitempty"` } // ArtifactList represents a list of GitHub artifacts. @@ -60,6 +64,21 @@ type ListArtifactsOptions struct { ListOptions } +// ArtifactPeriod represents the period for which the artifact and +// log of a workflow run is retained. +type ArtifactPeriod struct { + Days *int `json:"days,omitempty"` + MaximumAllowedDays *int `json:"maximum_allowed_days,omitempty"` +} + +func (a ArtifactPeriod) String() string { return Stringify(a) } + +// ArtifactPeriodOpt is used to specify the retention period of +// artifacts and logs in a workflow run. +type ArtifactPeriodOpt struct { + Days *int `json:"days,omitempty"` +} + // ListArtifacts lists all artifacts that belong to a repository. // // GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository diff --git a/vendor/github.com/google/go-github/v69/github/actions_cache.go b/vendor/github.com/google/go-github/v75/github/actions_cache.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/actions_cache.go rename to vendor/github.com/google/go-github/v75/github/actions_cache.go diff --git a/vendor/github.com/google/go-github/v75/github/actions_hosted_runners.go b/vendor/github.com/google/go-github/v75/github/actions_hosted_runners.go new file mode 100644 index 000000000..207b755fc --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/actions_hosted_runners.go @@ -0,0 +1,379 @@ +// Copyright 2025 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" + "errors" + "fmt" +) + +// HostedRunnerPublicIP represents the details of a public IP for GitHub-hosted runner. +type HostedRunnerPublicIP struct { + Enabled bool `json:"enabled"` // Whether public IP is enabled. + Prefix string `json:"prefix"` // The prefix for the public IP. Example: 20.80.208.150 + Length int `json:"length"` // The length of the IP prefix. Example: 28 +} + +// HostedRunnerMachineSpec represents the details of a particular machine specification for GitHub-hosted runner. +type HostedRunnerMachineSpec struct { + ID string `json:"id"` // The ID used for the `size` parameter when creating a new runner. Example: 8-core + CPUCores int `json:"cpu_cores"` // The number of cores. Example: 8 + MemoryGB int `json:"memory_gb"` // The available RAM for the machine spec. Example: 32 + StorageGB int `json:"storage_gb"` // The available SSD storage for the machine spec. Example: 300 +} + +// HostedRunner represents a single GitHub-hosted runner with additional details. +type HostedRunner struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` + Platform *string `json:"platform,omitempty"` + ImageDetails *HostedRunnerImageDetail `json:"image_details,omitempty"` + MachineSizeDetails *HostedRunnerMachineSpec `json:"machine_size_details,omitempty"` + Status *string `json:"status,omitempty"` + MaximumRunners *int64 `json:"maximum_runners,omitempty"` + PublicIPEnabled *bool `json:"public_ip_enabled,omitempty"` + PublicIPs []*HostedRunnerPublicIP `json:"public_ips,omitempty"` + LastActiveOn *Timestamp `json:"last_active_on,omitempty"` +} + +// HostedRunnerImageDetail represents the image details of a GitHub-hosted runners. +type HostedRunnerImageDetail struct { + ID *string `json:"id"` // The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. Example: ubuntu-20.04 + SizeGB *int64 `json:"size_gb"` // Image size in GB. Example: 86 + DisplayName *string `json:"display_name"` // Display name for this image. Example: 20.04 + Source *string `json:"source"` // The image provider. Example: github, partner, custom + Version *string `json:"version"` // The image version of the hosted runner pool. Example: latest +} + +// HostedRunners represents a collection of GitHub-hosted runners for an organization. +type HostedRunners struct { + TotalCount int `json:"total_count"` + Runners []*HostedRunner `json:"runners"` +} + +// ListHostedRunners lists all the GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners +func (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners", 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 + } + + runners := &HostedRunners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// HostedRunnerImage represents the image of GitHub-hosted runners. +// To list all available images, use GET /actions/hosted-runners/images/github-owned or GET /actions/hosted-runners/images/partner. +type HostedRunnerImage struct { + ID string `json:"id"` + Source string `json:"source"` + Version string `json:"version"` +} + +// HostedRunnerRequest specifies body parameters to Hosted Runner configuration. +type HostedRunnerRequest struct { + Name string `json:"name,omitempty"` + Image HostedRunnerImage `json:"image,omitempty"` + RunnerGroupID int64 `json:"runner_group_id,omitempty"` + Size string `json:"size,omitempty"` + MaximumRunners int64 `json:"maximum_runners,omitempty"` + EnableStaticIP bool `json:"enable_static_ip,omitempty"` + ImageVersion string `json:"image_version,omitempty"` +} + +// validateCreateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// that all required fields are properly set and that no invalid fields are present for hosted runner create request. +// +// If any of these conditions are violated, an appropriate error message is returned. +// Otherwise, nil is returned, indicating the request is valid. +func validateCreateHostedRunnerRequest(request *HostedRunnerRequest) error { + if request == nil { + return errors.New("request is required for creating a hosted runner") + } + if request.Size == "" { + return errors.New("size is required for creating a hosted runner") + } + if request.Image == (HostedRunnerImage{}) { + return errors.New("image is required for creating a hosted runner") + } + if request.Name == "" { + return errors.New("name is required for creating a hosted runner") + } + if request.RunnerGroupID == 0 { + return errors.New("runner group ID is required for creating a hosted runner") + } + if request.ImageVersion != "" { + return errors.New("imageVersion should not be set directly; use the Image struct to specify image details") + } + return nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization +// +//meta:operation POST /orgs/{org}/actions/hosted-runners +func (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/actions/hosted-runners", org) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image. +type HostedRunnerImageSpecs struct { + ID string `json:"id"` + Platform string `json:"platform"` + SizeGB int `json:"size_gb"` + DisplayName string `json:"display_name"` + Source string `json:"source"` +} + +// HostedRunnerImages represents the response containing the total count and details of runner images. +type HostedRunnerImages struct { + TotalCount int `json:"total_count"` + Images []*HostedRunnerImageSpecs `json:"images"` +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned +func (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/github-owned", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner +func (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/images/partner", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// HostedRunnerPublicIPLimits represents the static public IP limits for GitHub-hosted runners. +type HostedRunnerPublicIPLimits struct { + PublicIPs *PublicIPUsage `json:"public_ips"` +} + +// PublicIPUsage provides details of static public IP limits for GitHub-hosted runners. +type PublicIPUsage struct { + Maximum int64 `json:"maximum"` // The maximum number of static public IP addresses that can be used for Hosted Runners. Example: 50 + CurrentUsage int64 `json:"current_usage"` // The current number of static public IP addresses in use by Hosted Runners. Example: 17 +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/limits +func (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/limits", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + publicIPLimits := new(HostedRunnerPublicIPLimits) + resp, err := s.client.Do(ctx, req, publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// HostedRunnerMachineSpecs represents the response containing the total count and details of machine specs for GitHub-hosted runners. +type HostedRunnerMachineSpecs struct { + TotalCount int `json:"total_count"` + MachineSpecs []*HostedRunnerMachineSpec `json:"machine_specs"` +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes +func (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/machine-sizes", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + machineSpecs := new(HostedRunnerMachineSpecs) + resp, err := s.client.Do(ctx, req, machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// HostedRunnerPlatforms represents the response containing the total count and platforms for GitHub-hosted runners. +type HostedRunnerPlatforms struct { + TotalCount int `json:"total_count"` + Platforms []string `json:"platforms"` +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/platforms +func (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/platforms", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + platforms := new(HostedRunnerPlatforms) + resp, err := s.client.Do(ctx, req, platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// validateUpdateHostedRunnerRequest validates the provided HostedRunnerRequest to ensure +// that no disallowed updates are made for a hosted runner update request. +// +// If any of these conditions are violated, an appropriate error message is returned. +// Otherwise, nil is returned, indicating the request is valid for an update. +func validateUpdateHostedRunnerRequest(request *HostedRunnerRequest) error { + if request.Size != "" { + return errors.New("size cannot be updated, API does not support updating size") + } + if request.Image != (HostedRunnerImage{}) { + return errors.New("image struct should not be set directly; use the ImageVersion to specify version details") + } + return nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization +// +//meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id} +func (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/hosted-runners/%v", org, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/actions_oidc.go b/vendor/github.com/google/go-github/v75/github/actions_oidc.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/actions_oidc.go rename to vendor/github.com/google/go-github/v75/github/actions_oidc.go diff --git a/vendor/github.com/google/go-github/v69/github/actions_permissions_enterprise.go b/vendor/github.com/google/go-github/v75/github/actions_permissions_enterprise.go similarity index 64% rename from vendor/github.com/google/go-github/v69/github/actions_permissions_enterprise.go rename to vendor/github.com/google/go-github/v75/github/actions_permissions_enterprise.go index a6a85aa32..fc4b67110 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_permissions_enterprise.go +++ b/vendor/github.com/google/go-github/v75/github/actions_permissions_enterprise.go @@ -37,6 +37,15 @@ type DefaultWorkflowPermissionEnterprise struct { CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` } +// SelfHostRunnerPermissionsEnterprise represents the settings for whether organizations in the enterprise are allowed to manage self-hosted runners at the repository level. +type SelfHostRunnerPermissionsEnterprise struct { + DisableSelfHostedRunnersForAllOrgs *bool `json:"disable_self_hosted_runners_for_all_orgs,omitempty"` +} + +func (a SelfHostRunnerPermissionsEnterprise) String() string { + return Stringify(a) +} + // GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise @@ -256,3 +265,113 @@ func (s *ActionsService) EditDefaultWorkflowPermissionsInEnterprise(ctx context. return p, resp, nil } + +// GetArtifactAndLogRetentionPeriodInEnterprise gets the artifact and log retention period for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention +func (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string) (*ArtifactPeriod, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/artifact-and-log-retention", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + arp := new(ArtifactPeriod) + resp, err := s.client.Do(ctx, req, arp) + if err != nil { + return nil, resp, err + } + + return arp, resp, nil +} + +// EditArtifactAndLogRetentionPeriodInEnterprise sets the artifact and log retention period for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention +func (s *ActionsService) EditArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string, period ArtifactPeriodOpt) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/artifact-and-log-retention", enterprise) + req, err := s.client.NewRequest("PUT", u, period) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// GetSelfHostedRunnerPermissionsInEnterprise gets the self-hosted runner permissions for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-self-hosted-runners-permissions-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/self-hosted-runners +func (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string) (*SelfHostRunnerPermissionsEnterprise, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/self-hosted-runners", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(SelfHostRunnerPermissionsEnterprise) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// EditSelfHostedRunnerPermissionsInEnterprise sets the self-hosted runner permissions for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-self-hosted-runners-permissions-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/self-hosted-runners +func (s *ActionsService) EditSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string, permissions SelfHostRunnerPermissionsEnterprise) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/self-hosted-runners", enterprise) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// GetPrivateRepoForkPRWorkflowSettingsInEnterprise gets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos +func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string) (*WorkflowsPermissions, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-workflows-private-repos", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(WorkflowsPermissions) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise sets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-enterprise +// +//meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos +func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, permissions *WorkflowsPermissionsOpt) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/permissions/fork-pr-workflows-private-repos", enterprise) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v69/github/actions_permissions_orgs.go b/vendor/github.com/google/go-github/v75/github/actions_permissions_orgs.go similarity index 51% rename from vendor/github.com/google/go-github/v69/github/actions_permissions_orgs.go rename to vendor/github.com/google/go-github/v75/github/actions_permissions_orgs.go index 2f555f249..fdd3181c5 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_permissions_orgs.go +++ b/vendor/github.com/google/go-github/v75/github/actions_permissions_orgs.go @@ -50,6 +50,21 @@ type DefaultWorkflowPermissionOrganization struct { CanApprovePullRequestReviews *bool `json:"can_approve_pull_request_reviews,omitempty"` } +// SelfHostedRunnersSettingsOrganization represents the self-hosted runners permissions settings for repositories in an organization. +type SelfHostedRunnersSettingsOrganization struct { + EnabledRepositories *string `json:"enabled_repositories,omitempty"` + SelectedRepositoriesURL *string `json:"selected_repositories_url,omitempty"` +} + +func (s SelfHostedRunnersSettingsOrganization) String() string { + return Stringify(s) +} + +// SelfHostedRunnersSettingsOrganizationOpt specifies the self-hosted runners permissions settings for repositories in an organization. +type SelfHostedRunnersSettingsOrganizationOpt struct { + EnabledRepositories *string `json:"enabled_repositories,omitempty"` +} + // GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization. // // GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization @@ -269,3 +284,202 @@ func (s *ActionsService) EditDefaultWorkflowPermissionsInOrganization(ctx contex return p, resp, nil } + +// GetArtifactAndLogRetentionPeriodInOrganization gets the artifact and log retention period for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/artifact-and-log-retention +func (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string) (*ArtifactPeriod, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/artifact-and-log-retention", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + arp := new(ArtifactPeriod) + resp, err := s.client.Do(ctx, req, arp) + if err != nil { + return nil, resp, err + } + + return arp, resp, nil +} + +// EditArtifactAndLogRetentionPeriodInOrganization sets the artifact and log retention period for an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/artifact-and-log-retention +func (s *ActionsService) EditArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string, period ArtifactPeriodOpt) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/artifact-and-log-retention", org) + req, err := s.client.NewRequest("PUT", u, period) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// GetSelfHostedRunnersSettingsInOrganization gets the self-hosted runners permissions settings for repositories in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-self-hosted-runners-settings-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners +func (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string) (*SelfHostedRunnersSettingsOrganization, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + settings := new(SelfHostedRunnersSettingsOrganization) + resp, err := s.client.Do(ctx, req, settings) + if err != nil { + return nil, resp, err + } + + return settings, resp, nil +} + +// EditSelfHostedRunnersSettingsInOrganization sets the self-hosted runners permissions settings for repositories in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-self-hosted-runners-settings-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners +func (s *ActionsService) EditSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string, opt SelfHostedRunnersSettingsOrganizationOpt) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners", org) + + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// SelfHostedRunnersAllowedRepos represents the repositories that are allowed to use self-hosted runners in an organization. +type SelfHostedRunnersAllowedRepos struct { + TotalCount int `json:"total_count"` + Repositories []*Repository `json:"repositories"` +} + +// ListRepositoriesSelfHostedRunnersAllowedInOrganization lists the repositories that are allowed to use self-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories +func (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, opts *ListOptions) (*SelfHostedRunnersAllowedRepos, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories", 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 + } + + settings := new(SelfHostedRunnersAllowedRepos) + resp, err := s.client.Do(ctx, req, settings) + if err != nil { + return nil, resp, err + } + + return settings, resp, nil +} + +// SetRepositoriesSelfHostedRunnersAllowedInOrganization allows the list of repositories to use self-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories +func (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories", org) + + req, err := s.client.NewRequest("PUT", u, struct { + IDs []int64 `json:"selected_repository_ids"` + }{IDs: repositoryIDs}) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// AddRepositorySelfHostedRunnersAllowedInOrganization adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id} +func (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories/%v", org, repositoryID) + + req, err := s.client.NewRequest("PUT", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// RemoveRepositorySelfHostedRunnersAllowedInOrganization removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization +// +//meta:operation DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id} +func (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/self-hosted-runners/repositories/%v", org, repositoryID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + resp, err := s.client.Do(ctx, req, nil) + if err != nil { + return resp, err + } + + return resp, nil +} + +// GetPrivateRepoForkPRWorkflowSettingsInOrganization gets the settings for whether workflows from fork pull requests can run on private repositories in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-organization +// +//meta:operation GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos +func (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string) (*WorkflowsPermissions, *Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-workflows-private-repos", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(WorkflowsPermissions) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// UpdatePrivateRepoForkPRWorkflowSettingsInOrganization sets the settings for whether workflows from fork pull requests can run on private repositories in an organization. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-organization +// +//meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos +func (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, permissions *WorkflowsPermissionsOpt) (*Response, error) { + u := fmt.Sprintf("orgs/%v/actions/permissions/fork-pr-workflows-private-repos", org) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v69/github/actions_runner_groups.go b/vendor/github.com/google/go-github/v75/github/actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/actions_runner_groups.go rename to vendor/github.com/google/go-github/v75/github/actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v69/github/actions_runners.go b/vendor/github.com/google/go-github/v75/github/actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/actions_runners.go rename to vendor/github.com/google/go-github/v75/github/actions_runners.go diff --git a/vendor/github.com/google/go-github/v69/github/actions_secrets.go b/vendor/github.com/google/go-github/v75/github/actions_secrets.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/actions_secrets.go rename to vendor/github.com/google/go-github/v75/github/actions_secrets.go index cba85c100..f03d3fd19 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_secrets.go +++ b/vendor/github.com/google/go-github/v75/github/actions_secrets.go @@ -8,6 +8,7 @@ package github import ( "context" "encoding/json" + "errors" "fmt" "strconv" ) @@ -23,8 +24,8 @@ type PublicKey struct { // do not error out when unmarshaling. func (p *PublicKey) UnmarshalJSON(data []byte) error { var pk struct { - KeyID interface{} `json:"key_id"` - Key *string `json:"key"` + KeyID any `json:"key_id"` + Key *string `json:"key"` } if err := json.Unmarshal(data, &pk); err != nil { @@ -246,6 +247,10 @@ func (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *Enc // //meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("encrypted secret must be provided") + } + url := fmt.Sprintf("repos/%v/%v/actions/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -256,6 +261,10 @@ func (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, re // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name} func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("encrypted secret must be provided") + } + url := fmt.Sprintf("orgs/%v/actions/secrets/%v", org, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -266,6 +275,10 @@ func (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string // //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) { + if eSecret == nil { + return nil, errors.New("encrypted secret must be provided") + } + url := fmt.Sprintf("repositories/%v/environments/%v/secrets/%v", repoID, env, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -383,6 +396,10 @@ func (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string // //meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, url) } @@ -402,6 +419,10 @@ func (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url s // //meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + url := fmt.Sprintf("orgs/%v/actions/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, url) } diff --git a/vendor/github.com/google/go-github/v69/github/actions_variables.go b/vendor/github.com/google/go-github/v75/github/actions_variables.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/actions_variables.go rename to vendor/github.com/google/go-github/v75/github/actions_variables.go index bca46b6df..b192ba703 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_variables.go +++ b/vendor/github.com/google/go-github/v75/github/actions_variables.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" ) @@ -186,6 +187,10 @@ func (s *ActionsService) patchVariable(ctx context.Context, url string, variable // //meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name} func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) { + if variable == nil { + return nil, errors.New("variable must be provided") + } + url := fmt.Sprintf("repos/%v/%v/actions/variables/%v", owner, repo, variable.Name) return s.patchVariable(ctx, url, variable) } @@ -196,6 +201,10 @@ func (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo str // //meta:operation PATCH /orgs/{org}/actions/variables/{name} func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) { + if variable == nil { + return nil, errors.New("variable must be provided") + } + url := fmt.Sprintf("orgs/%v/actions/variables/%v", org, variable.Name) return s.patchVariable(ctx, url, variable) } @@ -206,6 +215,10 @@ func (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, vari // //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) { + if variable == nil { + return nil, errors.New("variable must be provided") + } + url := fmt.Sprintf("repos/%v/%v/environments/%v/variables/%v", owner, repo, env, variable.Name) return s.patchVariable(ctx, url, variable) } @@ -317,6 +330,13 @@ func (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url stri // //meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToVariable(ctx, url) } @@ -336,6 +356,13 @@ func (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url // //meta:operation DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id} func (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + url := fmt.Sprintf("orgs/%v/actions/variables/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromVariable(ctx, url) } diff --git a/vendor/github.com/google/go-github/v69/github/actions_workflow_jobs.go b/vendor/github.com/google/go-github/v75/github/actions_workflow_jobs.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/actions_workflow_jobs.go rename to vendor/github.com/google/go-github/v75/github/actions_workflow_jobs.go diff --git a/vendor/github.com/google/go-github/v69/github/actions_workflow_runs.go b/vendor/github.com/google/go-github/v75/github/actions_workflow_runs.go similarity index 99% rename from vendor/github.com/google/go-github/v69/github/actions_workflow_runs.go rename to vendor/github.com/google/go-github/v75/github/actions_workflow_runs.go index 20b9cfcd5..2e20f1be3 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_workflow_runs.go +++ b/vendor/github.com/google/go-github/v75/github/actions_workflow_runs.go @@ -106,6 +106,7 @@ type PendingDeploymentsRequest struct { Comment string `json:"comment"` } +// ReferencedWorkflow represents a referenced workflow in a workflow run. type ReferencedWorkflow struct { Path *string `json:"path,omitempty"` SHA *string `json:"sha,omitempty"` @@ -259,7 +260,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo // GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs // //meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs -func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) { +func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber) if s.client.RateLimitRedirectionalEndpoints { diff --git a/vendor/github.com/google/go-github/v69/github/actions_workflows.go b/vendor/github.com/google/go-github/v75/github/actions_workflows.go similarity index 89% rename from vendor/github.com/google/go-github/v69/github/actions_workflows.go rename to vendor/github.com/google/go-github/v75/github/actions_workflows.go index 0214e6abf..dbde83cf3 100644 --- a/vendor/github.com/google/go-github/v69/github/actions_workflows.go +++ b/vendor/github.com/google/go-github/v75/github/actions_workflows.go @@ -53,7 +53,27 @@ type CreateWorkflowDispatchEventRequest struct { // Inputs represents input keys and values configured in the workflow file. // The maximum number of properties is 10. // Default: Any default properties configured in the workflow file will be used when `inputs` are omitted. - Inputs map[string]interface{} `json:"inputs,omitempty"` + Inputs map[string]any `json:"inputs,omitempty"` +} + +// WorkflowsPermissions represents the permissions for workflows in a repository. +type WorkflowsPermissions struct { + RunWorkflowsFromForkPullRequests *bool `json:"run_workflows_from_fork_pull_requests,omitempty"` + SendWriteTokensToWorkflows *bool `json:"send_write_tokens_to_workflows,omitempty"` + SendSecretsAndVariables *bool `json:"send_secrets_and_variables,omitempty"` + RequireApprovalForForkPRWorkflows *bool `json:"require_approval_for_fork_pr_workflows,omitempty"` +} + +func (w WorkflowsPermissions) String() string { + return Stringify(w) +} + +// WorkflowsPermissionsOpt specifies options for editing workflows permissions in a repository. +type WorkflowsPermissionsOpt struct { + RunWorkflowsFromForkPullRequests bool `json:"run_workflows_from_fork_pull_requests"` + SendWriteTokensToWorkflows *bool `json:"send_write_tokens_to_workflows,omitempty"` + SendSecretsAndVariables *bool `json:"send_secrets_and_variables,omitempty"` + RequireApprovalForForkPRWorkflows *bool `json:"require_approval_for_fork_pr_workflows,omitempty"` } // ListWorkflows lists all workflows in a repository. diff --git a/vendor/github.com/google/go-github/v69/github/activity.go b/vendor/github.com/google/go-github/v75/github/activity.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/activity.go rename to vendor/github.com/google/go-github/v75/github/activity.go diff --git a/vendor/github.com/google/go-github/v69/github/activity_events.go b/vendor/github.com/google/go-github/v75/github/activity_events.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/activity_events.go rename to vendor/github.com/google/go-github/v75/github/activity_events.go diff --git a/vendor/github.com/google/go-github/v69/github/activity_notifications.go b/vendor/github.com/google/go-github/v75/github/activity_notifications.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/activity_notifications.go rename to vendor/github.com/google/go-github/v75/github/activity_notifications.go diff --git a/vendor/github.com/google/go-github/v69/github/activity_star.go b/vendor/github.com/google/go-github/v75/github/activity_star.go similarity index 94% rename from vendor/github.com/google/go-github/v69/github/activity_star.go rename to vendor/github.com/google/go-github/v75/github/activity_star.go index cebdacf76..782c09884 100644 --- a/vendor/github.com/google/go-github/v69/github/activity_star.go +++ b/vendor/github.com/google/go-github/v75/github/activity_star.go @@ -40,8 +40,7 @@ func (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches - req.Header.Set("Accept", mediaTypeStarringPreview) + req.Header.Set("Accept", mediaTypeStarring) var stargazers []*Stargazer resp, err := s.client.Do(ctx, req, &stargazers) @@ -91,8 +90,7 @@ func (s *ActivityService) ListStarred(ctx context.Context, user string, opts *Ac return nil, nil, err } - // TODO: remove custom Accept header when APIs fully launch - acceptHeaders := []string{mediaTypeStarringPreview, mediaTypeTopicsPreview} + acceptHeaders := []string{mediaTypeStarring, mediaTypeTopicsPreview} req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) var repos []*StarredRepository diff --git a/vendor/github.com/google/go-github/v69/github/activity_watching.go b/vendor/github.com/google/go-github/v75/github/activity_watching.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/activity_watching.go rename to vendor/github.com/google/go-github/v75/github/activity_watching.go diff --git a/vendor/github.com/google/go-github/v69/github/admin.go b/vendor/github.com/google/go-github/v75/github/admin.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/admin.go rename to vendor/github.com/google/go-github/v75/github/admin.go index adf55d641..021a12ad8 100644 --- a/vendor/github.com/google/go-github/v69/github/admin.go +++ b/vendor/github.com/google/go-github/v75/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.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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/v69/github/admin_orgs.go b/vendor/github.com/google/go-github/v75/github/admin_orgs.go similarity index 88% rename from vendor/github.com/google/go-github/v69/github/admin_orgs.go rename to vendor/github.com/google/go-github/v75/github/admin_orgs.go index 8b50756b0..eb3f8d2df 100644 --- a/vendor/github.com/google/go-github/v69/github/admin_orgs.go +++ b/vendor/github.com/google/go-github/v75/github/admin_orgs.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" ) @@ -22,7 +23,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.15/rest/enterprise-admin/orgs#create-an-organization +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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,16 +62,23 @@ type RenameOrgResponse struct { // RenameOrg renames an organization in GitHub Enterprise. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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) { + if org == nil { + return nil, nil, errors.New("organization must be provided") + } + if org.Login == nil { + return nil, nil, errors.New("login must be provided") + } + return s.RenameOrgByName(ctx, *org.Login, newName) } // RenameOrgByName renames an organization in GitHub Enterprise using its current name. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/orgs#update-an-organization-name +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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/v69/github/admin_stats.go b/vendor/github.com/google/go-github/v75/github/admin_stats.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/admin_stats.go rename to vendor/github.com/google/go-github/v75/github/admin_stats.go index a6e406bec..07465b8d6 100644 --- a/vendor/github.com/google/go-github/v69/github/admin_stats.go +++ b/vendor/github.com/google/go-github/v75/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.15/rest/enterprise-admin/admin-stats#get-all-statistics +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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/v69/github/admin_users.go b/vendor/github.com/google/go-github/v75/github/admin_users.go similarity index 94% rename from vendor/github.com/google/go-github/v69/github/admin_users.go rename to vendor/github.com/google/go-github/v75/github/admin_users.go index 6877cef46..843a177be 100644 --- a/vendor/github.com/google/go-github/v69/github/admin_users.go +++ b/vendor/github.com/google/go-github/v75/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.15/rest/enterprise-admin/users#create-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#delete-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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/v69/github/apps.go b/vendor/github.com/google/go-github/v75/github/apps.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/apps.go rename to vendor/github.com/google/go-github/v75/github/apps.go index 3dd392d08..441a64fb1 100644 --- a/vendor/github.com/google/go-github/v69/github/apps.go +++ b/vendor/github.com/google/go-github/v75/github/apps.go @@ -56,6 +56,8 @@ type InstallationTokenOptions struct { Permissions *InstallationPermissions `json:"permissions,omitempty"` } +// InstallationTokenListRepoOptions allow restricting a token's access to a list of all repositories in an installation. +// It differs from InstallationTokenOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array. 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. diff --git a/vendor/github.com/google/go-github/v69/github/apps_hooks.go b/vendor/github.com/google/go-github/v75/github/apps_hooks.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/apps_hooks.go rename to vendor/github.com/google/go-github/v75/github/apps_hooks.go diff --git a/vendor/github.com/google/go-github/v69/github/apps_hooks_deliveries.go b/vendor/github.com/google/go-github/v75/github/apps_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/apps_hooks_deliveries.go rename to vendor/github.com/google/go-github/v75/github/apps_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v69/github/apps_installation.go b/vendor/github.com/google/go-github/v75/github/apps_installation.go similarity index 87% rename from vendor/github.com/google/go-github/v69/github/apps_installation.go rename to vendor/github.com/google/go-github/v75/github/apps_installation.go index d430511d0..57d6b4e76 100644 --- a/vendor/github.com/google/go-github/v69/github/apps_installation.go +++ b/vendor/github.com/google/go-github/v75/github/apps_installation.go @@ -8,7 +8,6 @@ package github import ( "context" "fmt" - "strings" ) // ListRepositories represents the response from the list repos endpoints. @@ -33,14 +32,6 @@ func (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRe return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var r *ListRepositories resp, err := s.client.Do(ctx, req, &r) @@ -69,14 +60,6 @@ func (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOpt return nil, nil, err } - // TODO: remove custom Accept headers when APIs fully launch. - acceptHeaders := []string{ - mediaTypeTopicsPreview, - mediaTypeRepositoryVisibilityPreview, - mediaTypeRepositoryTemplatePreview, - } - req.Header.Set("Accept", strings.Join(acceptHeaders, ", ")) - var r *ListRepositories resp, err := s.client.Do(ctx, req, &r) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/apps_manifest.go b/vendor/github.com/google/go-github/v75/github/apps_manifest.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/apps_manifest.go rename to vendor/github.com/google/go-github/v75/github/apps_manifest.go diff --git a/vendor/github.com/google/go-github/v69/github/apps_marketplace.go b/vendor/github.com/google/go-github/v75/github/apps_marketplace.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/apps_marketplace.go rename to vendor/github.com/google/go-github/v75/github/apps_marketplace.go diff --git a/vendor/github.com/google/go-github/v69/github/attestations.go b/vendor/github.com/google/go-github/v75/github/attestations.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/attestations.go rename to vendor/github.com/google/go-github/v75/github/attestations.go diff --git a/vendor/github.com/google/go-github/v69/github/authorizations.go b/vendor/github.com/google/go-github/v75/github/authorizations.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/authorizations.go rename to vendor/github.com/google/go-github/v75/github/authorizations.go index 8b8a67d55..6f22e40a1 100644 --- a/vendor/github.com/google/go-github/v69/github/authorizations.go +++ b/vendor/github.com/google/go-github/v75/github/authorizations.go @@ -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.15/rest/enterprise-admin/users#create-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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/v69/github/billing.go b/vendor/github.com/google/go-github/v75/github/billing.go similarity index 69% rename from vendor/github.com/google/go-github/v69/github/billing.go rename to vendor/github.com/google/go-github/v75/github/billing.go index 09b1a5d01..0776358cd 100644 --- a/vendor/github.com/google/go-github/v69/github/billing.go +++ b/vendor/github.com/google/go-github/v75/github/billing.go @@ -63,6 +63,46 @@ type AdvancedSecurityCommittersBreakdown struct { LastPushedDate *string `json:"last_pushed_date,omitempty"` } +// UsageReportOptions specifies optional parameters for the enhanced billing platform usage report. +type UsageReportOptions struct { + // If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025. + // Default value is the current year. + Year *int `url:"year,omitempty"` + + // If specified, only return results for a single month. The value of month is an integer between 1 and 12. + // If no year is specified the default year is used. + Month *int `url:"month,omitempty"` + + // If specified, only return results for a single day. The value of day is an integer between 1 and 31. + // If no year or month is specified, the default year and month are used. + Day *int `url:"day,omitempty"` + + // If specified, only return results for a single hour. The value of hour is an integer between 0 and 23. + // If no year, month, or day is specified, the default year, month, and day are used. + Hour *int `url:"hour,omitempty"` +} + +// UsageItem represents a single usage item in the enhanced billing platform report. +type UsageItem struct { + Date *string `json:"date"` + Product *string `json:"product"` + SKU *string `json:"sku"` + Quantity *float64 `json:"quantity"` + UnitType *string `json:"unitType"` + PricePerUnit *float64 `json:"pricePerUnit"` + GrossAmount *float64 `json:"grossAmount"` + DiscountAmount *float64 `json:"discountAmount"` + NetAmount *float64 `json:"netAmount"` + RepositoryName *string `json:"repositoryName,omitempty"` + // Organization name is only used for organization-level reports. + OrganizationName *string `json:"organizationName,omitempty"` +} + +// UsageReport represents the enhanced billing platform usage report response. +type UsageReport struct { + UsageItems []*UsageItem `json:"usageItems,omitempty"` +} + // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. // // GitHub API docs: https://docs.github.com/rest/billing/billing#get-github-actions-billing-for-an-organization @@ -216,3 +256,59 @@ func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) return storageUserBilling, resp, nil } + +// GetUsageReportOrg returns a report of the total usage for an organization using the enhanced billing platform. +// +// Note: This endpoint is only available to organizations with access to the enhanced billing platform. +// +// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-an-organization +// +//meta:operation GET /organizations/{org}/settings/billing/usage +func (s *BillingService) GetUsageReportOrg(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) { + u := fmt.Sprintf("organizations/%v/settings/billing/usage", org) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + usageReport := new(UsageReport) + resp, err := s.client.Do(ctx, req, usageReport) + if err != nil { + return nil, resp, err + } + + return usageReport, resp, nil +} + +// GetUsageReportUser returns a report of the total usage for a user using the enhanced billing platform. +// +// Note: This endpoint is only available to users with access to the enhanced billing platform. +// +// GitHub API docs: https://docs.github.com/rest/billing/enhanced-billing#get-billing-usage-report-for-a-user +// +//meta:operation GET /users/{username}/settings/billing/usage +func (s *BillingService) GetUsageReportUser(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) { + u := fmt.Sprintf("users/%v/settings/billing/usage", user) + 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 + } + + usageReport := new(UsageReport) + resp, err := s.client.Do(ctx, req, usageReport) + if err != nil { + return nil, resp, err + } + + return usageReport, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/checks.go b/vendor/github.com/google/go-github/v75/github/checks.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/checks.go rename to vendor/github.com/google/go-github/v75/github/checks.go index 2f0f65bf9..d39cfa536 100644 --- a/vendor/github.com/google/go-github/v69/github/checks.go +++ b/vendor/github.com/google/go-github/v75/github/checks.go @@ -269,6 +269,8 @@ type ListCheckRunsResults struct { } // ListCheckRunsForRef lists check runs for a specific ref. +// The ref can be a commit SHA, branch name `heads/`, or tag name `tags/`. +// For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. // // GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference // @@ -345,7 +347,7 @@ func (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo strin // ListCheckSuiteOptions represents parameters to list check suites. type ListCheckSuiteOptions struct { CheckName *string `url:"check_name,omitempty"` // Filters checks suites by the name of the check run. - AppID *int `url:"app_id,omitempty"` // Filters check suites by GitHub App id. + AppID *int64 `url:"app_id,omitempty"` // Filters check suites by GitHub App id. ListOptions } @@ -357,6 +359,8 @@ type ListCheckSuiteResults struct { } // ListCheckSuitesForRef lists check suite for a specific ref. +// The ref can be a commit SHA, branch name `heads/`, or tag name `tags/`. +// For more information, see "Git References" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References. // // GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference // diff --git a/vendor/github.com/google/go-github/v75/github/classroom.go b/vendor/github.com/google/go-github/v75/github/classroom.go new file mode 100644 index 000000000..8f6ce1451 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/classroom.go @@ -0,0 +1,82 @@ +// Copyright 2025 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" +) + +// ClassroomService handles communication with the GitHub Classroom related +// methods of the GitHub API. +// +// GitHub API docs: https://docs.github.com/rest/classroom/classroom +type ClassroomService service + +// Classroom represents a GitHub Classroom. +type Classroom struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Archived *bool `json:"archived,omitempty"` + Organization *Organization `json:"organization,omitempty"` + URL *string `json:"url,omitempty"` +} + +func (c Classroom) String() string { + return Stringify(c) +} + +// ClassroomAssignment represents a GitHub Classroom assignment. +type ClassroomAssignment struct { + ID *int64 `json:"id,omitempty"` + PublicRepo *bool `json:"public_repo,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + InviteLink *string `json:"invite_link,omitempty"` + InvitationsEnabled *bool `json:"invitations_enabled,omitempty"` + Slug *string `json:"slug,omitempty"` + StudentsAreRepoAdmins *bool `json:"students_are_repo_admins,omitempty"` + FeedbackPullRequestsEnabled *bool `json:"feedback_pull_requests_enabled,omitempty"` + MaxTeams *int `json:"max_teams,omitempty"` + MaxMembers *int `json:"max_members,omitempty"` + Editor *string `json:"editor,omitempty"` + Accepted *int `json:"accepted,omitempty"` + Submitted *int `json:"submitted,omitempty"` + Passing *int `json:"passing,omitempty"` + Language *string `json:"language,omitempty"` + Deadline *Timestamp `json:"deadline,omitempty"` + StarterCodeRepository *Repository `json:"starter_code_repository,omitempty"` + Classroom *Classroom `json:"classroom,omitempty"` +} + +func (a ClassroomAssignment) String() string { + return Stringify(a) +} + +// GetAssignment gets a GitHub Classroom assignment. Assignment will only be +// returned if the current user is an administrator of the GitHub Classroom +// for the assignment. +// +// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-an-assignment +// +//meta:operation GET /assignments/{assignment_id} +func (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error) { + u := fmt.Sprintf("assignments/%v", assignmentID) + + req, err := s.client.NewRequest(http.MethodGet, u, nil) + if err != nil { + return nil, nil, err + } + + assignment := new(ClassroomAssignment) + resp, err := s.client.Do(ctx, req, assignment) + if err != nil { + return nil, resp, err + } + + return assignment, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/code_scanning.go b/vendor/github.com/google/go-github/v75/github/code_scanning.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/code_scanning.go rename to vendor/github.com/google/go-github/v75/github/code_scanning.go diff --git a/vendor/github.com/google/go-github/v69/github/codesofconduct.go b/vendor/github.com/google/go-github/v75/github/codesofconduct.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/codesofconduct.go rename to vendor/github.com/google/go-github/v75/github/codesofconduct.go diff --git a/vendor/github.com/google/go-github/v69/github/codespaces.go b/vendor/github.com/google/go-github/v75/github/codespaces.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/codespaces.go rename to vendor/github.com/google/go-github/v75/github/codespaces.go diff --git a/vendor/github.com/google/go-github/v69/github/codespaces_secrets.go b/vendor/github.com/google/go-github/v75/github/codespaces_secrets.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/codespaces_secrets.go rename to vendor/github.com/google/go-github/v75/github/codespaces_secrets.go index 438c27f8f..ba4b9abd9 100644 --- a/vendor/github.com/google/go-github/v69/github/codespaces_secrets.go +++ b/vendor/github.com/google/go-github/v75/github/codespaces_secrets.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" ) @@ -187,6 +188,10 @@ func (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, // //meta:operation PUT /user/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("encrypted secret must be provided") + } + u := fmt.Sprintf("user/codespaces/secrets/%v", eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) } @@ -199,6 +204,10 @@ func (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecre // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("encrypted secret must be provided") + } + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v", org, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) } @@ -211,6 +220,10 @@ func (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org str // //meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name} func (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("encrypted secret must be provided") + } + u := fmt.Sprintf("repos/%v/%v/codespaces/secrets/%v", owner, repo, eSecret.Name) return s.createOrUpdateSecret(ctx, u, eSecret) } @@ -382,6 +395,13 @@ func (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url st // //meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) } @@ -394,6 +414,13 @@ func (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, nam // //meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.addSelectedRepoToSecret(ctx, u) } @@ -420,6 +447,13 @@ func (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url str // //meta:operation DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + u := fmt.Sprintf("user/codespaces/secrets/%v/repositories/%v", name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) } @@ -432,6 +466,13 @@ func (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context // //meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id} func (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + u := fmt.Sprintf("orgs/%v/codespaces/secrets/%v/repositories/%v", org, name, *repo.ID) return s.removeSelectedRepoFromSecret(ctx, u) } diff --git a/vendor/github.com/google/go-github/v69/github/copilot.go b/vendor/github.com/google/go-github/v75/github/copilot.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/copilot.go rename to vendor/github.com/google/go-github/v75/github/copilot.go index b9adfcb4e..25f5969eb 100644 --- a/vendor/github.com/google/go-github/v69/github/copilot.go +++ b/vendor/github.com/google/go-github/v75/github/copilot.go @@ -46,14 +46,14 @@ type ListCopilotSeatsResponse struct { // 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"` + Assignee any `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. @@ -185,6 +185,7 @@ type CopilotMetrics struct { CopilotDotcomPullRequests *CopilotDotcomPullRequests `json:"copilot_dotcom_pull_requests,omitempty"` } +// UnmarshalJSON implements the json.Unmarshaler interface. func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { // Using an alias to avoid infinite recursion when calling json.Unmarshal type alias CopilotSeatDetails @@ -203,7 +204,12 @@ func (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error { cp.PlanType = seatDetail.PlanType switch v := seatDetail.Assignee.(type) { - case map[string]interface{}: + case nil: + // Assignee can be null according to GitHub API specification. + // See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization + // Note: Copilot API is in public preview and subject to change. + cp.Assignee = nil + case map[string]any: jsonData, err := json.Marshal(seatDetail.Assignee) if err != nil { return err diff --git a/vendor/github.com/google/go-github/v69/github/dependabot.go b/vendor/github.com/google/go-github/v75/github/dependabot.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/dependabot.go rename to vendor/github.com/google/go-github/v75/github/dependabot.go diff --git a/vendor/github.com/google/go-github/v69/github/dependabot_alerts.go b/vendor/github.com/google/go-github/v75/github/dependabot_alerts.go similarity index 94% rename from vendor/github.com/google/go-github/v69/github/dependabot_alerts.go rename to vendor/github.com/google/go-github/v75/github/dependabot_alerts.go index c274f07be..67e624c9e 100644 --- a/vendor/github.com/google/go-github/v69/github/dependabot_alerts.go +++ b/vendor/github.com/google/go-github/v75/github/dependabot_alerts.go @@ -29,6 +29,15 @@ type AdvisoryCWEs struct { Name *string `json:"name,omitempty"` } +// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System. +// +// For more information, see: +// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/ +type AdvisoryEPSS struct { + Percentage float64 `json:"percentage"` + Percentile float64 `json:"percentile"` +} + // DependabotSecurityAdvisory represents the GitHub Security Advisory. type DependabotSecurityAdvisory struct { GHSAID *string `json:"ghsa_id,omitempty"` @@ -39,6 +48,7 @@ type DependabotSecurityAdvisory struct { Severity *string `json:"severity,omitempty"` CVSS *AdvisoryCVSS `json:"cvss,omitempty"` CWEs []*AdvisoryCWEs `json:"cwes,omitempty"` + EPSS *AdvisoryEPSS `json:"epss,omitempty"` Identifiers []*AdvisoryIdentifier `json:"identifiers,omitempty"` References []*AdvisoryReference `json:"references,omitempty"` PublishedAt *Timestamp `json:"published_at,omitempty"` diff --git a/vendor/github.com/google/go-github/v69/github/dependabot_secrets.go b/vendor/github.com/google/go-github/v75/github/dependabot_secrets.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/dependabot_secrets.go rename to vendor/github.com/google/go-github/v75/github/dependabot_secrets.go index e85c805a6..b4b3e0aa5 100644 --- a/vendor/github.com/google/go-github/v69/github/dependabot_secrets.go +++ b/vendor/github.com/google/go-github/v75/github/dependabot_secrets.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" ) @@ -150,6 +151,10 @@ func (s *DependabotService) putSecret(ctx context.Context, url string, eSecret * // //meta:operation PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("dependabot encrypted secret must be provided") + } + url := fmt.Sprintf("repos/%v/%v/dependabot/secrets/%v", owner, repo, eSecret.Name) return s.putSecret(ctx, url, eSecret) } @@ -160,6 +165,10 @@ func (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name} func (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) { + if eSecret == nil { + return nil, errors.New("dependabot encrypted secret must be provided") + } + repoIDs := make([]string, len(eSecret.SelectedRepositoryIDs)) for i, secret := range eSecret.SelectedRepositoryIDs { repoIDs[i] = fmt.Sprintf("%v", secret) @@ -264,6 +273,13 @@ func (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, or // //meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("PUT", url, nil) if err != nil { @@ -279,6 +295,13 @@ func (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, // //meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id} func (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) { + if repo == nil { + return nil, errors.New("repository must be provided") + } + if repo.ID == nil { + return nil, errors.New("id must be provided") + } + url := fmt.Sprintf("orgs/%v/dependabot/secrets/%v/repositories/%v", org, name, *repo.ID) req, err := s.client.NewRequest("DELETE", url, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v75/github/dependency_graph.go b/vendor/github.com/google/go-github/v75/github/dependency_graph.go new file mode 100644 index 000000000..8d9a26313 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/dependency_graph.go @@ -0,0 +1,129 @@ +// 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" +) + +// DependencyGraphService handles communication with the dependency graph +// related methods of the GitHub API. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph +type DependencyGraphService service + +// SBOM represents a software bill of materials, which describes the +// packages/libraries that a repository depends on. +type SBOM struct { + SBOM *SBOMInfo `json:"sbom,omitempty"` +} + +// CreationInfo represents when the SBOM was created and who created it. +type CreationInfo struct { + Created *Timestamp `json:"created,omitempty"` + Creators []string `json:"creators,omitempty"` +} + +// RepoDependencies represents the dependencies of a repo. +type RepoDependencies struct { + SPDXID *string `json:"SPDXID,omitempty"` + // Package name + Name *string `json:"name,omitempty"` + VersionInfo *string `json:"versionInfo,omitempty"` + DownloadLocation *string `json:"downloadLocation,omitempty"` + FilesAnalyzed *bool `json:"filesAnalyzed,omitempty"` + LicenseConcluded *string `json:"licenseConcluded,omitempty"` + LicenseDeclared *string `json:"licenseDeclared,omitempty"` + ExternalRefs []*PackageExternalRef `json:"externalRefs,omitempty"` +} + +// PackageExternalRef allows an Package to reference an external sources of additional information, +// like asset identifiers, or downloadable content that are relevant to the package, +// Example for identifiers (e.g., PURL/SWID/CPE) for a package in the SBOM. +// https://spdx.github.io/spdx-spec/v2.3/package-information/#721-external-reference-field +type PackageExternalRef struct { + // ReferenceCategory specifies the external reference categories such + // SECURITY", "PACKAGE-MANAGER", "PERSISTENT-ID", or "OTHER" + // Example: "PACKAGE-MANAGER" + ReferenceCategory string `json:"referenceCategory"` + + // ReferenceType specifies the type of external reference. + // For PACKAGE-MANAGER, it could be "purl"; other types include "cpe22Type", "swid", etc. + ReferenceType string `json:"referenceType"` + + // ReferenceLocator is the actual unique identifier or URI for the external reference. + // Example: "pkg:golang/github.com/spf13/cobra@1.8.1" + ReferenceLocator string `json:"referenceLocator"` +} + +// SBOMRelationship provides information about the relationship between two SPDX elements. +// Element could be packages or files in the SBOM. +// For example, to represent a relationship between two different Files, between a Package and a File, +// between two Packages, or between one SPDXDocument and another SPDXDocument. +// https://spdx.github.io/spdx-spec/v2.3/relationships-between-SPDX-elements/ +type SBOMRelationship struct { + // SPDXElementID is the identifier of the SPDX element that has a relationship. + // Example: "SPDXRef-github-interlynk-io-sbomqs-main-f43c98" + SPDXElementID string `json:"spdxElementId"` + + // RelatedSPDXElement is the identifier of the related SPDX element. + // Example: "SPDXRef-golang-github.comspf13-cobra-1.8.1-75c946" + RelatedSPDXElement string `json:"relatedSpdxElement"` + + // RelationshipType describes the type of relationship between the two elements. + // Such as "DEPENDS_ON", "DESCRIBES", "CONTAINS", etc., as defined by SPDX 2.3. + // Example: "DEPENDS_ON", "CONTAINS", "DESCRIBES", etc. + RelationshipType string `json:"relationshipType"` +} + +// SBOMInfo represents a software bill of materials (SBOM) using SPDX. +// SPDX is an open standard for SBOMs that +// identifies and catalogs components, licenses, copyrights, security +// references, and other metadata relating to software. +type SBOMInfo struct { + SPDXID *string `json:"SPDXID,omitempty"` + SPDXVersion *string `json:"spdxVersion,omitempty"` + CreationInfo *CreationInfo `json:"creationInfo,omitempty"` + + // Repo name + Name *string `json:"name,omitempty"` + DataLicense *string `json:"dataLicense,omitempty"` + DocumentDescribes []string `json:"documentDescribes,omitempty"` + DocumentNamespace *string `json:"documentNamespace,omitempty"` + + // List of packages dependencies + Packages []*RepoDependencies `json:"packages,omitempty"` + + // List of relationships between packages + Relationships []*SBOMRelationship `json:"relationships,omitempty"` +} + +func (s SBOM) String() string { + return Stringify(s) +} + +// GetSBOM fetches the software bill of materials for a repository. +// +// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom +func (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/dependency-graph/sbom", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var sbom *SBOM + resp, err := s.client.Do(ctx, req, &sbom) + if err != nil { + return nil, resp, err + } + + return sbom, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/dependency_graph_snapshots.go b/vendor/github.com/google/go-github/v75/github/dependency_graph_snapshots.go similarity index 89% rename from vendor/github.com/google/go-github/v69/github/dependency_graph_snapshots.go rename to vendor/github.com/google/go-github/v75/github/dependency_graph_snapshots.go index 0606b9815..ddfecf429 100644 --- a/vendor/github.com/google/go-github/v69/github/dependency_graph_snapshots.go +++ b/vendor/github.com/google/go-github/v75/github/dependency_graph_snapshots.go @@ -15,6 +15,15 @@ import ( // 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"` + // User-defined metadata to store domain-specific information limited to 8 keys with scalar values. + // This metadata overrides auto-detected values from the package URL and GitHub's database. + // Common fields include: + // - "licenses": license information (e.g., "MIT", "Apache-2.0") + // - "name": package name + // - "version": package version + // - "manager": package manager (e.g., "npm", "pip", "maven") + // - "description": package description + Metadata map[string]any `json:"metadata,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. @@ -59,6 +68,7 @@ type DependencyGraphSnapshotManifestFile struct { type DependencyGraphSnapshotManifest struct { Name *string `json:"name,omitempty"` File *DependencyGraphSnapshotManifestFile `json:"file,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` Resolved map[string]*DependencyGraphSnapshotResolvedDependency `json:"resolved,omitempty"` } @@ -72,6 +82,7 @@ type DependencyGraphSnapshot struct { Job *DependencyGraphSnapshotJob `json:"job,omitempty"` Detector *DependencyGraphSnapshotDetector `json:"detector,omitempty"` Scanned *Timestamp `json:"scanned,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` Manifests map[string]*DependencyGraphSnapshotManifest `json:"manifests,omitempty"` } diff --git a/vendor/github.com/google/go-github/v69/github/doc.go b/vendor/github.com/google/go-github/v75/github/doc.go similarity index 85% rename from vendor/github.com/google/go-github/v69/github/doc.go rename to vendor/github.com/google/go-github/v75/github/doc.go index 79d92d9ee..7fff8857a 100644 --- a/vendor/github.com/google/go-github/v69/github/doc.go +++ b/vendor/github.com/google/go-github/v75/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v69/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v75/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,27 +31,27 @@ 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://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() +NOTE: Using the [context] package, one can easily +pass cancellation 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. For more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory. # Authentication -Use Client.WithAuthToken to configure your client to authenticate using an Oauth token +Use [Client.WithAuthToken] to configure your client to authenticate using an Oauth token (for example, a personal access token). This is what is needed for a majority of use cases aside from GitHub Apps. client := github.NewClient(nil).WithAuthToken("... your access token ...") -Note that when using an authenticated Client, all calls made by the client will +Note that when using an authenticated [Client], all calls made by the client will include the specified OAuth token. Therefore, authenticated clients should almost never be shared between different users. For API methods that require HTTP Basic Authentication, use the -BasicAuthTransport. +[BasicAuthTransport]. GitHub Apps authentication can be provided by the https://github.com/bradleyfalzon/ghinstallation package. @@ -100,15 +100,15 @@ limited to 60 requests per hour, while authenticated clients can make up to clients are limited to 10 requests per minute, while authenticated clients can make up to 30 requests per minute. To receive the higher rate limit when making calls that are not issued on behalf of a user, -use UnauthenticatedRateLimitedTransport. +use [UnauthenticatedRateLimitedTransport]. -The returned Response.Rate value contains the rate limit information +The returned [Response].[Rate] value contains the rate limit information from the most recent API call. If a recent enough response isn't available, you can use RateLimits to fetch the most up-to-date rate limit data for the client. -To detect an API rate limit error, you can check if its type is *github.RateLimitError. -For secondary rate limits, you can check if its type is *github.AbuseRateLimitError: +To detect an API rate limit error, you can check if its type is *[RateLimitError]. +For secondary rate limits, you can check if its type is *[AbuseRateLimitError]: repos, _, err := client.Repositories.List(ctx, "", nil) if _, ok := err.(*github.RateLimitError); ok { @@ -129,7 +129,7 @@ the GitHub side. Methods known to behave like this are documented specifying this behavior. To detect this condition of error, you can check if its type is -*github.AcceptedError: +*[AcceptedError]: stats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo) if _, ok := err.(*github.AcceptedError); ok { @@ -142,9 +142,9 @@ The GitHub REST API has good support for conditional HTTP requests via the ETag header which will help prevent you from burning through your rate limit, as well as help speed up your application. go-github does not handle conditional requests directly, but is instead designed to work with a -caching http.Transport. +caching [http.Transport]. -Typically, an RFC 7234 compliant HTTP cache such as https://github.com/gregjones/httpcache +Typically, an RFC 9111 compliant HTTP cache such as https://github.com/bartventer/httpcache is recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport package relies on (undocumented) GitHub specific cache logic and is recommended when making requests using short-lived credentials such as a @@ -157,7 +157,7 @@ https://docs.github.com/rest/overview/resources-in-the-rest-api#conditional-requ All structs for GitHub resources use pointer values for all non-repeated fields. This allows distinguishing between unset fields and those set to a zero-value. -Helper functions have been provided to easily create these pointers for string, +A helper function, [Ptr], has been provided to easily create these pointers for string, bool, and int values. For example: // create a new private repository named "foo" @@ -173,10 +173,10 @@ Users who have worked with protocol buffers should find this pattern familiar. All requests for resource collections (repos, pull requests, issues, etc.) support pagination. Pagination options are described in the -github.ListOptions struct and passed to the list methods directly or as an +[ListOptions] struct and passed to the list methods directly or as an embedded type of a more specific list options struct (for example -github.PullRequestListOptions). Pages information is available via the -github.Response struct. +[PullRequestListOptions]). Pages information is available via the +[Response] struct. client := github.NewClient(nil) diff --git a/vendor/github.com/google/go-github/v69/github/emojis.go b/vendor/github.com/google/go-github/v75/github/emojis.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/emojis.go rename to vendor/github.com/google/go-github/v75/github/emojis.go diff --git a/vendor/github.com/google/go-github/v69/github/enterprise.go b/vendor/github.com/google/go-github/v75/github/enterprise.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise.go rename to vendor/github.com/google/go-github/v75/github/enterprise.go diff --git a/vendor/github.com/google/go-github/v75/github/enterprise_actions_hosted_runners.go b/vendor/github.com/google/go-github/v75/github/enterprise_actions_hosted_runners.go new file mode 100644 index 000000000..e82ba9b80 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/enterprise_actions_hosted_runners.go @@ -0,0 +1,234 @@ +// Copyright 2025 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" +) + +// ListHostedRunners lists all the GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", 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 + } + + runners := &HostedRunners{} + resp, err := s.client.Do(ctx, req, &runners) + if err != nil { + return nil, resp, err + } + + return runners, resp, nil +} + +// CreateHostedRunner creates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners +func (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request *HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateCreateHostedRunnerRequest(request); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners", enterprise) + req, err := s.client.NewRequest("POST", u, request) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned +func (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/github-owned", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner +func (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/images/partner", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunnerImages := new(HostedRunnerImages) + resp, err := s.client.Do(ctx, req, hostedRunnerImages) + if err != nil { + return nil, resp, err + } + + return hostedRunnerImages, resp, nil +} + +// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits +func (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/limits", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + publicIPLimits := new(HostedRunnerPublicIPLimits) + resp, err := s.client.Do(ctx, req, publicIPLimits) + if err != nil { + return nil, resp, err + } + + return publicIPLimits, resp, nil +} + +// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes +func (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/machine-sizes", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + machineSpecs := new(HostedRunnerMachineSpecs) + resp, err := s.client.Do(ctx, req, machineSpecs) + if err != nil { + return nil, resp, err + } + + return machineSpecs, resp, nil +} + +// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms +func (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/platforms", enterprise) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + platforms := new(HostedRunnerPlatforms) + resp, err := s.client.Do(ctx, req, platforms) + if err != nil { + return nil, resp, err + } + + return platforms, resp, nil +} + +// GetHostedRunner gets a GitHub-hosted runner in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, updateReq HostedRunnerRequest) (*HostedRunner, *Response, error) { + if err := validateUpdateHostedRunnerRequest(&updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} + +// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id} +func (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) { + u := fmt.Sprintf("enterprises/%v/actions/hosted-runners/%v", enterprise, runnerID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, nil, err + } + + hostedRunner := new(HostedRunner) + resp, err := s.client.Do(ctx, req, hostedRunner) + if err != nil { + return nil, resp, err + } + + return hostedRunner, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_actions_runner_groups.go b/vendor/github.com/google/go-github/v75/github/enterprise_actions_runner_groups.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise_actions_runner_groups.go rename to vendor/github.com/google/go-github/v75/github/enterprise_actions_runner_groups.go diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_actions_runners.go b/vendor/github.com/google/go-github/v75/github/enterprise_actions_runners.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise_actions_runners.go rename to vendor/github.com/google/go-github/v75/github/enterprise_actions_runners.go diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_audit_log.go b/vendor/github.com/google/go-github/v75/github/enterprise_audit_log.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise_audit_log.go rename to vendor/github.com/google/go-github/v75/github/enterprise_audit_log.go diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_code_security_and_analysis.go b/vendor/github.com/google/go-github/v75/github/enterprise_code_security_and_analysis.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise_code_security_and_analysis.go rename to vendor/github.com/google/go-github/v75/github/enterprise_code_security_and_analysis.go diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes.go b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes.go rename to vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes.go index e14836eb0..c5e38386a 100644 --- a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes.go +++ b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes.go @@ -74,7 +74,7 @@ type ReleaseVersion struct { // CheckSystemRequirements checks if GHES system nodes meet the system requirements. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes // //meta:operation GET /manage/v1/checks/system-requirements func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) { @@ -95,7 +95,7 @@ func (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*Syste // ClusterStatus gets the status of all services running on each cluster node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes // //meta:operation GET /manage/v1/cluster/status func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) { @@ -116,7 +116,7 @@ func (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, // ReplicationStatus gets the status of all services running on each replica node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes // //meta:operation GET /manage/v1/replication/status func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) { @@ -140,7 +140,7 @@ func (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQue // GetNodeReleaseVersions gets the version information deployed to each node. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes // //meta:operation GET /manage/v1/version func (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) { diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_config.go b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_config.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_config.go rename to vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_config.go index 10fb8590e..ded48ddc7 100644 --- a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_config.go +++ b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_config.go @@ -305,7 +305,7 @@ type NodeDetails struct { // ConfigApplyEvents gets events from the command ghe-config-apply. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply // //meta:operation GET /manage/v1/config/apply/events func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) { @@ -330,7 +330,7 @@ func (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigA // InitialConfig initializes the GitHub Enterprise instance with a license and password. // After initializing the instance, you need to run an apply to apply the configuration. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password // //meta:operation POST /manage/v1/config/init func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) { @@ -351,7 +351,7 @@ func (s *EnterpriseService) InitialConfig(ctx context.Context, license, password // License gets the current license information for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information // //meta:operation GET /manage/v1/config/license func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) { @@ -372,7 +372,7 @@ func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Res // UploadLicense uploads a new license to the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license // //meta:operation PUT /manage/v1/config/license func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) { @@ -390,7 +390,7 @@ func (s *EnterpriseService) UploadLicense(ctx context.Context, license string) ( // LicenseStatus gets the current license status for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#check-a-license +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#check-a-license // //meta:operation GET /manage/v1/config/license/check func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) { @@ -412,7 +412,7 @@ func (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, // NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance. // This is required for clustered setups. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes // //meta:operation GET /manage/v1/config/nodes func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) { @@ -436,7 +436,7 @@ func (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOpt // Settings gets the current configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-ghes-settings // //meta:operation GET /manage/v1/config/settings func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) { @@ -457,7 +457,7 @@ func (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Res // UpdateSettings updates the configuration settings for the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-settings +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-settings // //meta:operation PUT /manage/v1/config/settings func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) { @@ -476,7 +476,7 @@ func (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSett // ConfigApply triggers a configuration apply run on the GitHub Enterprise instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run // //meta:operation POST /manage/v1/config/apply func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) { @@ -497,7 +497,7 @@ func (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOp // ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance. // You can request lat one or specific id one. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run // //meta:operation GET /manage/v1/config/apply func (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) { diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_maintenance.go b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_maintenance.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_maintenance.go rename to vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_maintenance.go index 3b1de92df..8b27b32a4 100644 --- a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_maintenance.go +++ b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_maintenance.go @@ -46,7 +46,7 @@ type MaintenanceOptions struct { // GetMaintenanceStatus gets the status of maintenance mode for all nodes. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode // //meta:operation GET /manage/v1/maintenance func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) { @@ -71,7 +71,7 @@ func (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *Node // CreateMaintenance sets the maintenance mode for the instance. // With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode // //meta:operation POST /manage/v1/maintenance func (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) { diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_ssh.go b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_ssh.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_ssh.go rename to vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_ssh.go index 77d252165..d60f89779 100644 --- a/vendor/github.com/google/go-github/v69/github/enterprise_manage_ghes_ssh.go +++ b/vendor/github.com/google/go-github/v75/github/enterprise_manage_ghes_ssh.go @@ -31,7 +31,7 @@ type ClusterSSHKey struct { // DeleteSSHKey deletes the SSH key from the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#delete-a-ssh-key // //meta:operation DELETE /manage/v1/access/ssh func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { @@ -55,7 +55,7 @@ func (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SS // GetSSHKey gets the SSH keys configured for the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys // //meta:operation GET /manage/v1/access/ssh func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) { @@ -76,7 +76,7 @@ func (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *R // CreateSSHKey adds a new SSH key to the instance. // -// GitHub API docs: https://docs.github.com/enterprise-server@3.15/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key // //meta:operation POST /manage/v1/access/ssh func (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) { diff --git a/vendor/github.com/google/go-github/v75/github/enterprise_network_configurations.go b/vendor/github.com/google/go-github/v75/github/enterprise_network_configurations.go new file mode 100644 index 000000000..a6a690d78 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/enterprise_network_configurations.go @@ -0,0 +1,139 @@ +// Copyright 2025 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" +) + +// ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-configurations +func (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations", 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 + } + + networks := &NetworkConfigurations{} + resp, err := s.client.Do(ctx, req, networks) + if err != nil { + return nil, resp, err + } + return networks, resp, nil +} + +// CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation POST /enterprises/{enterprise}/network-configurations +func (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(createReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/network-configurations", enterprise) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + network := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + + return network, resp, nil +} + +// GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + network := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + return network, resp, nil +} + +// UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise +// +//meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + network := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, network) + if err != nil { + return nil, resp, err + } + return network, resp, nil +} + +// DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise +// +//meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id} +func (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) { + u := fmt.Sprintf("enterprises/%v/network-configurations/%v", enterprise, networkID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + return s.client.Do(ctx, req, nil) +} + +// GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise +// +//meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id} +func (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) { + u := fmt.Sprintf("enterprises/%v/network-settings/%v", enterprise, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resource := &NetworkSettingsResource{} + resp, err := s.client.Do(ctx, req, resource) + if err != nil { + return nil, resp, err + } + return resource, resp, err +} diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_properties.go b/vendor/github.com/google/go-github/v75/github/enterprise_properties.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise_properties.go rename to vendor/github.com/google/go-github/v75/github/enterprise_properties.go diff --git a/vendor/github.com/google/go-github/v69/github/enterprise_rules.go b/vendor/github.com/google/go-github/v75/github/enterprise_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/enterprise_rules.go rename to vendor/github.com/google/go-github/v75/github/enterprise_rules.go diff --git a/vendor/github.com/google/go-github/v69/github/event.go b/vendor/github.com/google/go-github/v75/github/event.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/event.go rename to vendor/github.com/google/go-github/v75/github/event.go index e98606bce..446db7fa0 100644 --- a/vendor/github.com/google/go-github/v69/github/event.go +++ b/vendor/github.com/google/go-github/v75/github/event.go @@ -27,7 +27,7 @@ func (e Event) String() string { // ParsePayload parses the event payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (e *Event) ParsePayload() (interface{}, error) { +func (e *Event) ParsePayload() (any, error) { // It would be nice if e.Type were the snake_case name of the event, // but the existing interface uses the struct name instead. payload := EventForType(typeToMessageMapping[e.GetType()]) @@ -44,7 +44,7 @@ func (e *Event) ParsePayload() (interface{}, error) { // // Deprecated: Use ParsePayload instead, which returns an error // rather than panics if JSON unmarshaling raw payload fails. -func (e *Event) Payload() (payload interface{}) { +func (e *Event) Payload() (payload any) { var err error payload, err = e.ParsePayload() if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/event_types.go b/vendor/github.com/google/go-github/v75/github/event_types.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/event_types.go rename to vendor/github.com/google/go-github/v75/github/event_types.go index 0df3b30c3..480ed8dfb 100644 --- a/vendor/github.com/google/go-github/v69/github/event_types.go +++ b/vendor/github.com/google/go-github/v75/github/event_types.go @@ -354,6 +354,12 @@ type DiscussionCommentEvent struct { // CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent. type CommentDiscussion struct { + // AuthorAssociation is the comment author's relationship to the repository. + // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Discussions REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/discussions/comments#get-a-discussion-comment AuthorAssociation *string `json:"author_association,omitempty"` Body *string `json:"body,omitempty"` ChildCommentCount *int `json:"child_comment_count,omitempty"` @@ -403,9 +409,15 @@ type Discussion struct { Comments *int `json:"comments,omitempty"` CreatedAt *Timestamp `json:"created_at,omitempty"` UpdatedAt *Timestamp `json:"updated_at,omitempty"` - AuthorAssociation *string `json:"author_association,omitempty"` - ActiveLockReason *string `json:"active_lock_reason,omitempty"` - Body *string `json:"body,omitempty"` + // AuthorAssociation is the discussion author's relationship to the repository. + // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Discussions REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/discussions/discussions#get-a-discussion + AuthorAssociation *string `json:"author_association,omitempty"` + ActiveLockReason *string `json:"active_lock_reason,omitempty"` + Body *string `json:"body,omitempty"` } // DiscussionCategory represents a discussion category in a GitHub DiscussionEvent. @@ -858,8 +870,10 @@ type MergeGroup struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group type MergeGroupEvent struct { - // The action that was performed. Currently, can only be checks_requested. + // The action that was performed. Possible values are: "checks_requested", "destroyed". Action *string `json:"action,omitempty"` + // Reason is populated when the action is "destroyed". Possible values: "merged", "invalidated", "dequeued". + Reason *string `json:"reason,omitempty"` // The merge group. MergeGroup *MergeGroup `json:"merge_group,omitempty"` @@ -1144,6 +1158,7 @@ type ProjectV2ItemEvent struct { // ProjectV2ItemChange represents a project v2 item change. type ProjectV2ItemChange struct { ArchivedAt *ArchivedAt `json:"archived_at,omitempty"` + FieldValue *FieldValue `json:"field_value,omitempty"` } // ArchivedAt represents an archiving date change. @@ -1152,6 +1167,16 @@ type ArchivedAt struct { To *Timestamp `json:"to,omitempty"` } +// FieldValue represents an editing field value change. +type FieldValue struct { + FieldNodeID *string `json:"field_node_id,omitempty"` + FieldType *string `json:"field_type,omitempty"` + FieldName *string `json:"field_name,omitempty"` + ProjectNumber *int64 `json:"project_number,omitempty"` + From json.RawMessage `json:"from,omitempty"` + To json.RawMessage `json:"to,omitempty"` +} + // ProjectV2Item represents an item belonging to a project. type ProjectV2Item struct { ID *int64 `json:"id,omitempty"` @@ -1341,13 +1366,28 @@ type PullRequestTargetEvent struct { // // GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push type PushEvent struct { - PushID *int64 `json:"push_id,omitempty"` - Head *string `json:"head,omitempty"` - Ref *string `json:"ref,omitempty"` - Size *int `json:"size,omitempty"` - Commits []*HeadCommit `json:"commits,omitempty"` - Before *string `json:"before,omitempty"` - DistinctSize *int `json:"distinct_size,omitempty"` + PushID *int64 `json:"push_id,omitempty"` + Head *string `json:"head,omitempty"` + Ref *string `json:"ref,omitempty"` + // Size is the number of commits in the push. + // + // Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025. + // Use the Commits REST API endpoint to get commit information. + // See: https://docs.github.com/rest/commits/commits#list-commits + Size *int `json:"size,omitempty"` + // Commits is the list of commits in the push event. + // + // Deprecated: GitHub will remove commit summaries from Events API payloads on October 7, 2025. + // Use the Commits REST API endpoint to get detailed commit information. + // See: https://docs.github.com/rest/commits/commits#list-commits + Commits []*HeadCommit `json:"commits,omitempty"` + Before *string `json:"before,omitempty"` + // DistinctSize is the number of distinct commits in the push. + // + // Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025. + // Use the Compare REST API endpoint to get detailed comparison information. + // See: https://docs.github.com/rest/commits/commits#compare-two-commits + DistinctSize *int `json:"distinct_size,omitempty"` // The following fields are only populated by Webhook events. Action *string `json:"action,omitempty"` @@ -1398,44 +1438,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]interface{} `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]any `json:"custom_properties,omitempty"` } // PushEventRepoOwner is a basic representation of user/org in a PushEvent payload. @@ -1444,6 +1484,26 @@ type PushEventRepoOwner struct { Email *string `json:"email,omitempty"` } +// RegistryPackageEvent represents activity related to GitHub Packages. +// The Webhook event name is "registry_package". +// +// This event is triggered when a GitHub Package is published or updated. +// +// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#registry_package +type RegistryPackageEvent struct { + // Action is the action that was performed. + // Can be "published" or "updated". + Action *string `json:"action,omitempty"` + RegistryPackage *Package `json:"registry_package,omitempty"` + Repository *Repository `json:"repository,omitempty"` + Organization *Organization `json:"organization,omitempty"` + Enterprise *Enterprise `json:"enterprise,omitempty"` + Sender *User `json:"sender,omitempty"` + + // The following fields are only populated by Webhook events. + Installation *Installation `json:"installation,omitempty"` +} + // ReleaseEvent is triggered when a release is published, unpublished, created, // edited, deleted, or prereleased. // The Webhook event name is "release". diff --git a/vendor/github.com/google/go-github/v69/github/gists.go b/vendor/github.com/google/go-github/v75/github/gists.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/gists.go rename to vendor/github.com/google/go-github/v75/github/gists.go diff --git a/vendor/github.com/google/go-github/v69/github/gists_comments.go b/vendor/github.com/google/go-github/v75/github/gists_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/gists_comments.go rename to vendor/github.com/google/go-github/v75/github/gists_comments.go diff --git a/vendor/github.com/google/go-github/v69/github/git.go b/vendor/github.com/google/go-github/v75/github/git.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/git.go rename to vendor/github.com/google/go-github/v75/github/git.go diff --git a/vendor/github.com/google/go-github/v69/github/git_blobs.go b/vendor/github.com/google/go-github/v75/github/git_blobs.go similarity index 90% rename from vendor/github.com/google/go-github/v69/github/git_blobs.go rename to vendor/github.com/google/go-github/v75/github/git_blobs.go index d89042888..c734d595b 100644 --- a/vendor/github.com/google/go-github/v69/github/git_blobs.go +++ b/vendor/github.com/google/go-github/v75/github/git_blobs.go @@ -26,7 +26,7 @@ type Blob struct { // GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob // //meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha} -func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha string) (*Blob, *Response, error) { +func (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -71,7 +71,7 @@ func (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([ // GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob // //meta:operation POST /repos/{owner}/{repo}/git/blobs -func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string, blob *Blob) (*Blob, *Response, error) { +func (s *GitService) CreateBlob(ctx context.Context, owner, repo string, blob Blob) (*Blob, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/blobs", owner, repo) req, err := s.client.NewRequest("POST", u, blob) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/git_commits.go b/vendor/github.com/google/go-github/v75/github/git_commits.go similarity index 94% rename from vendor/github.com/google/go-github/v69/github/git_commits.go rename to vendor/github.com/google/go-github/v75/github/git_commits.go index d7ed3ecbe..4da15bb0d 100644 --- a/vendor/github.com/google/go-github/v69/github/git_commits.go +++ b/vendor/github.com/google/go-github/v75/github/git_commits.go @@ -37,6 +37,7 @@ type MessageSigner interface { // MessageSignerFunc is a single function implementation of MessageSigner. type MessageSignerFunc func(w io.Writer, r io.Reader) error +// Sign implements the MessageSigner interface for MessageSignerFunc. func (f MessageSignerFunc) Sign(w io.Writer, r io.Reader) error { return f(w, r) } @@ -84,7 +85,7 @@ func (c CommitAuthor) String() string { // GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object // //meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha} -func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, sha string) (*Commit, *Response, error) { +func (s *GitService) GetCommit(ctx context.Context, owner, repo, sha string) (*Commit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -110,6 +111,8 @@ type createCommit struct { Signature *string `json:"signature,omitempty"` } +// CreateCommitOptions specifies optional parameters to creates +// a new commit in a repository. type CreateCommitOptions struct { // CreateCommit will sign the commit with this signer. See MessageSigner doc for more details. // Ignored on commits where Verification.Signature is defined. @@ -126,10 +129,7 @@ type CreateCommitOptions struct { // GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit // //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, errors.New("commit must be provided") - } +func (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commit Commit, opts *CreateCommitOptions) (*Commit, *Response, error) { if opts == nil { opts = &CreateCommitOptions{} } diff --git a/vendor/github.com/google/go-github/v69/github/git_refs.go b/vendor/github.com/google/go-github/v75/github/git_refs.go similarity index 71% rename from vendor/github.com/google/go-github/v69/github/git_refs.go rename to vendor/github.com/google/go-github/v75/github/git_refs.go index 91eb6dd43..735aef006 100644 --- a/vendor/github.com/google/go-github/v69/github/git_refs.go +++ b/vendor/github.com/google/go-github/v75/github/git_refs.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" "net/url" "strings" @@ -14,6 +15,7 @@ import ( // Reference represents a GitHub reference. type Reference struct { + // The name of the fully qualified reference, i.e.: `refs/heads/master`. Ref *string `json:"ref"` URL *string `json:"url"` Object *GitObject `json:"object"` @@ -35,24 +37,25 @@ func (o GitObject) String() string { return Stringify(o) } -// createRefRequest represents the payload for creating a reference. -type createRefRequest struct { - Ref *string `json:"ref"` - SHA *string `json:"sha"` +// CreateRef represents the payload for creating a reference. +type CreateRef struct { + Ref string `json:"ref"` + SHA string `json:"sha"` } -// updateRefRequest represents the payload for updating a reference. -type updateRefRequest struct { - SHA *string `json:"sha"` - Force *bool `json:"force"` +// UpdateRef represents the payload for updating a reference. +type UpdateRef struct { + SHA string `json:"sha"` + Force *bool `json:"force,omitempty"` } // GetRef fetches a single reference in a repository. +// The ref must be formatted as `heads/` for branches and `tags/` for tags. // // GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference // //meta:operation GET /repos/{owner}/{repo}/git/ref/{ref} -func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref string) (*Reference, *Response, error) { +func (s *GitService) GetRef(ctx context.Context, owner, repo, ref string) (*Reference, *Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/ref/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("GET", u, nil) @@ -82,6 +85,7 @@ func refURLEscape(ref string) string { // ReferenceListOptions specifies optional parameters to the // GitService.ListMatchingRefs method. type ReferenceListOptions struct { + // The ref must be formatted as `heads/` for branches and `tags/` for tags. Ref string `url:"-"` ListOptions @@ -123,13 +127,20 @@ func (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo string, o // GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference // //meta:operation POST /repos/{owner}/{repo}/git/refs -func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, ref *Reference) (*Reference, *Response, error) { +func (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref CreateRef) (*Reference, *Response, error) { + if ref.Ref == "" { + return nil, nil, errors.New("ref must be provided") + } + + if ref.SHA == "" { + return nil, nil, errors.New("sha must be provided") + } + + // ensure the 'refs/' prefix is present + ref.Ref = "refs/" + strings.TrimPrefix(ref.Ref, "refs/") + u := fmt.Sprintf("repos/%v/%v/git/refs", owner, repo) - req, err := s.client.NewRequest("POST", u, &createRefRequest{ - // back-compat with previous behavior that didn't require 'refs/' prefix - Ref: Ptr("refs/" + strings.TrimPrefix(*ref.Ref, "refs/")), - SHA: ref.Object.SHA, - }) + req, err := s.client.NewRequest("POST", u, ref) if err != nil { return nil, nil, err } @@ -148,13 +159,18 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r // GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference // //meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref} -func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, ref *Reference, force bool) (*Reference, *Response, error) { - refPath := strings.TrimPrefix(*ref.Ref, "refs/") +func (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, updateRef UpdateRef) (*Reference, *Response, error) { + if ref == "" { + return nil, nil, errors.New("ref must be provided") + } + + if updateRef.SHA == "" { + return nil, nil, errors.New("sha must be provided") + } + + refPath := strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(refPath)) - req, err := s.client.NewRequest("PATCH", u, &updateRefRequest{ - SHA: ref.Object.SHA, - Force: &force, - }) + req, err := s.client.NewRequest("PATCH", u, updateRef) if err != nil { return nil, nil, err } @@ -173,7 +189,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r // GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference // //meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref} -func (s *GitService) DeleteRef(ctx context.Context, owner string, repo string, ref string) (*Response, error) { +func (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) { ref = strings.TrimPrefix(ref, "refs/") u := fmt.Sprintf("repos/%v/%v/git/refs/%v", owner, repo, refURLEscape(ref)) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v69/github/git_tags.go b/vendor/github.com/google/go-github/v75/github/git_tags.go similarity index 63% rename from vendor/github.com/google/go-github/v69/github/git_tags.go rename to vendor/github.com/google/go-github/v75/github/git_tags.go index 67321566f..750b03760 100644 --- a/vendor/github.com/google/go-github/v69/github/git_tags.go +++ b/vendor/github.com/google/go-github/v75/github/git_tags.go @@ -22,14 +22,12 @@ type Tag struct { NodeID *string `json:"node_id,omitempty"` } -// createTagRequest represents the body of a CreateTag request. This is mostly -// identical to Tag with the exception that the object SHA and Type are -// top-level fields, rather than being nested inside a JSON object. -type createTagRequest struct { - Tag *string `json:"tag,omitempty"` - Message *string `json:"message,omitempty"` - Object *string `json:"object,omitempty"` - Type *string `json:"type,omitempty"` +// CreateTag represents the payload for creating a tag. +type CreateTag struct { + Tag string `json:"tag,omitempty"` + Message string `json:"message,omitempty"` + Object string `json:"object,omitempty"` + Type string `json:"type,omitempty"` Tagger *CommitAuthor `json:"tagger,omitempty"` } @@ -38,7 +36,7 @@ type createTagRequest struct { // GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag // //meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha} -func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha string) (*Tag, *Response, error) { +func (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -59,21 +57,10 @@ func (s *GitService) GetTag(ctx context.Context, owner string, repo string, sha // GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object // //meta:operation POST /repos/{owner}/{repo}/git/tags -func (s *GitService) CreateTag(ctx context.Context, owner string, repo string, tag *Tag) (*Tag, *Response, error) { +func (s *GitService) CreateTag(ctx context.Context, owner, repo string, tag CreateTag) (*Tag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/tags", owner, repo) - // convert Tag into a createTagRequest - tagRequest := &createTagRequest{ - Tag: tag.Tag, - Message: tag.Message, - Tagger: tag.Tagger, - } - if tag.Object != nil { - tagRequest.Object = tag.Object.SHA - tagRequest.Type = tag.Object.Type - } - - req, err := s.client.NewRequest("POST", u, tagRequest) + req, err := s.client.NewRequest("POST", u, tag) if err != nil { return nil, nil, err } diff --git a/vendor/github.com/google/go-github/v69/github/git_trees.go b/vendor/github.com/google/go-github/v75/github/git_trees.go similarity index 90% rename from vendor/github.com/google/go-github/v69/github/git_trees.go rename to vendor/github.com/google/go-github/v75/github/git_trees.go index b8eed58e1..2b701a3c6 100644 --- a/vendor/github.com/google/go-github/v69/github/git_trees.go +++ b/vendor/github.com/google/go-github/v75/github/git_trees.go @@ -58,6 +58,7 @@ type treeEntryWithFileDelete struct { URL *string `json:"url,omitempty"` } +// MarshalJSON implements the json.Marshaler interface. func (t *TreeEntry) MarshalJSON() ([]byte, error) { if t.SHA == nil && t.Content == nil { return json.Marshal(struct { @@ -96,7 +97,7 @@ func (t *TreeEntry) MarshalJSON() ([]byte, error) { // GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree // //meta:operation GET /repos/{owner}/{repo}/git/trees/{tree_sha} -func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha string, recursive bool) (*Tree, *Response, error) { +func (s *GitService) GetTree(ctx context.Context, owner, repo, sha string, recursive bool) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees/%v", owner, repo, sha) if recursive { u += "?recursive=1" @@ -118,8 +119,8 @@ func (s *GitService) GetTree(ctx context.Context, owner string, repo string, sha // createTree represents the body of a CreateTree request. type createTree struct { - BaseTree string `json:"base_tree,omitempty"` - Entries []interface{} `json:"tree"` + BaseTree string `json:"base_tree,omitempty"` + Entries []any `json:"tree"` } // CreateTree creates a new tree in a repository. If both a tree and a nested @@ -129,10 +130,10 @@ type createTree struct { // GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree // //meta:operation POST /repos/{owner}/{repo}/git/trees -func (s *GitService) CreateTree(ctx context.Context, owner string, repo string, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { +func (s *GitService) CreateTree(ctx context.Context, owner, repo, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) { u := fmt.Sprintf("repos/%v/%v/git/trees", owner, repo) - newEntries := make([]interface{}, 0, len(entries)) + newEntries := make([]any, 0, len(entries)) for _, entry := range entries { if entry.Content == nil && entry.SHA == nil { newEntries = append(newEntries, treeEntryWithFileDelete{ diff --git a/vendor/github.com/google/go-github/v69/github/github-accessors.go b/vendor/github.com/google/go-github/v75/github/github-accessors.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/github-accessors.go rename to vendor/github.com/google/go-github/v75/github/github-accessors.go index 6270bc1fc..3de23373e 100644 --- a/vendor/github.com/google/go-github/v69/github/github-accessors.go +++ b/vendor/github.com/google/go-github/v75/github/github-accessors.go @@ -934,6 +934,14 @@ func (a *Artifact) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (a *Artifact) GetDigest() string { + if a == nil || a.Digest == nil { + return "" + } + return *a.Digest +} + // GetExpired returns the Expired field if it's non-nil, zero value otherwise. func (a *Artifact) GetExpired() bool { if a == nil || a.Expired == nil { @@ -1014,6 +1022,30 @@ func (a *ArtifactList) GetTotalCount() int64 { return *a.TotalCount } +// GetDays returns the Days field if it's non-nil, zero value otherwise. +func (a *ArtifactPeriod) GetDays() int { + if a == nil || a.Days == nil { + return 0 + } + return *a.Days +} + +// GetMaximumAllowedDays returns the MaximumAllowedDays field if it's non-nil, zero value otherwise. +func (a *ArtifactPeriod) GetMaximumAllowedDays() int { + if a == nil || a.MaximumAllowedDays == nil { + return 0 + } + return *a.MaximumAllowedDays +} + +// GetDays returns the Days field if it's non-nil, zero value otherwise. +func (a *ArtifactPeriodOpt) GetDays() int { + if a == nil || a.Days == nil { + return 0 + } + return *a.Days +} + // GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise. func (a *ArtifactWorkflowRun) GetHeadBranch() string { if a == nil || a.HeadBranch == nil { @@ -1110,6 +1142,14 @@ func (a *AuditEntry) GetActorLocation() *ActorLocation { return a.ActorLocation } +// GetAdditionalFields returns the AdditionalFields map if it's non-nil, an empty map otherwise. +func (a *AuditEntry) GetAdditionalFields() map[string]any { + if a == nil || a.AdditionalFields == nil { + return map[string]any{} + } + return a.AdditionalFields +} + // GetBusiness returns the Business field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetBusiness() string { if a == nil || a.Business == nil { @@ -1134,6 +1174,14 @@ func (a *AuditEntry) GetCreatedAt() Timestamp { return *a.CreatedAt } +// GetData returns the Data map if it's non-nil, an empty map otherwise. +func (a *AuditEntry) GetData() map[string]any { + if a == nil || a.Data == nil { + return map[string]any{} + } + return a.Data +} + // GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise. func (a *AuditEntry) GetDocumentID() string { if a == nil || a.DocumentID == nil { @@ -1598,6 +1646,14 @@ func (b *Branch) GetProtection() *Protection { return b.Protection } +// GetProtectionURL returns the ProtectionURL field if it's non-nil, zero value otherwise. +func (b *Branch) GetProtectionURL() string { + if b == nil || b.ProtectionURL == nil { + return "" + } + return *b.ProtectionURL +} + // GetCommit returns the Commit field. func (b *BranchCommit) GetCommit() *Commit { if b == nil { @@ -1846,6 +1902,14 @@ func (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string return *b.RequiredStatusChecksEnforcementLevel } +// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise. +func (b *BranchProtectionRule) GetRequireLastPushApproval() bool { + if b == nil || b.RequireLastPushApproval == nil { + return false + } + return *b.RequireLastPushApproval +} + // GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field if it's non-nil, zero value otherwise. func (b *BranchProtectionRule) GetSignatureRequirementEnforcementLevel() string { if b == nil || b.SignatureRequirementEnforcementLevel == nil { @@ -2462,6 +2526,198 @@ func (c *CheckSuitePreferenceResults) GetRepository() *Repository { return c.Repository } +// GetArchived returns the Archived field if it's non-nil, zero value otherwise. +func (c *Classroom) GetArchived() bool { + if c == nil || c.Archived == nil { + return false + } + return *c.Archived +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *Classroom) 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 *Classroom) GetName() string { + if c == nil || c.Name == nil { + return "" + } + return *c.Name +} + +// GetOrganization returns the Organization field. +func (c *Classroom) GetOrganization() *Organization { + if c == nil { + return nil + } + return c.Organization +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (c *Classroom) GetURL() string { + if c == nil || c.URL == nil { + return "" + } + return *c.URL +} + +// GetAccepted returns the Accepted field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetAccepted() int { + if c == nil || c.Accepted == nil { + return 0 + } + return *c.Accepted +} + +// GetClassroom returns the Classroom field. +func (c *ClassroomAssignment) GetClassroom() *Classroom { + if c == nil { + return nil + } + return c.Classroom +} + +// GetDeadline returns the Deadline field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetDeadline() Timestamp { + if c == nil || c.Deadline == nil { + return Timestamp{} + } + return *c.Deadline +} + +// GetEditor returns the Editor field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetEditor() string { + if c == nil || c.Editor == nil { + return "" + } + return *c.Editor +} + +// GetFeedbackPullRequestsEnabled returns the FeedbackPullRequestsEnabled field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetFeedbackPullRequestsEnabled() bool { + if c == nil || c.FeedbackPullRequestsEnabled == nil { + return false + } + return *c.FeedbackPullRequestsEnabled +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetID() int64 { + if c == nil || c.ID == nil { + return 0 + } + return *c.ID +} + +// GetInvitationsEnabled returns the InvitationsEnabled field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetInvitationsEnabled() bool { + if c == nil || c.InvitationsEnabled == nil { + return false + } + return *c.InvitationsEnabled +} + +// GetInviteLink returns the InviteLink field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetInviteLink() string { + if c == nil || c.InviteLink == nil { + return "" + } + return *c.InviteLink +} + +// GetLanguage returns the Language field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetLanguage() string { + if c == nil || c.Language == nil { + return "" + } + return *c.Language +} + +// GetMaxMembers returns the MaxMembers field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetMaxMembers() int { + if c == nil || c.MaxMembers == nil { + return 0 + } + return *c.MaxMembers +} + +// GetMaxTeams returns the MaxTeams field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetMaxTeams() int { + if c == nil || c.MaxTeams == nil { + return 0 + } + return *c.MaxTeams +} + +// GetPassing returns the Passing field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetPassing() int { + if c == nil || c.Passing == nil { + return 0 + } + return *c.Passing +} + +// GetPublicRepo returns the PublicRepo field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetPublicRepo() bool { + if c == nil || c.PublicRepo == nil { + return false + } + return *c.PublicRepo +} + +// GetSlug returns the Slug field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetSlug() string { + if c == nil || c.Slug == nil { + return "" + } + return *c.Slug +} + +// GetStarterCodeRepository returns the StarterCodeRepository field. +func (c *ClassroomAssignment) GetStarterCodeRepository() *Repository { + if c == nil { + return nil + } + return c.StarterCodeRepository +} + +// GetStudentsAreRepoAdmins returns the StudentsAreRepoAdmins field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetStudentsAreRepoAdmins() bool { + if c == nil || c.StudentsAreRepoAdmins == nil { + return false + } + return *c.StudentsAreRepoAdmins +} + +// GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetSubmitted() int { + if c == nil || c.Submitted == nil { + return 0 + } + return *c.Submitted +} + +// GetTitle returns the Title field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetTitle() string { + if c == nil || c.Title == nil { + return "" + } + return *c.Title +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (c *ClassroomAssignment) GetType() string { + if c == nil || c.Type == nil { + return "" + } + return *c.Type +} + // GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise. func (c *ClusterSSHKey) GetFingerprint() string { if c == nil || c.Fingerprint == nil { @@ -5902,6 +6158,30 @@ func (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string { return *c.Name } +// GetColor returns the Color field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetColor() string { + if c == nil || c.Color == nil { + return "" + } + return *c.Color +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetDescription() string { + if c == nil || c.Description == nil { + return "" + } + return *c.Description +} + +// GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise. +func (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool { + if c == nil || c.IsPrivate == nil { + return false + } + return *c.IsPrivate +} + // GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise. func (c *CreateOrUpdateOrgRoleOptions) GetBaseRole() string { if c == nil || c.BaseRole == nil { @@ -5966,6 +6246,14 @@ func (c *CreateRunnerGroupRequest) GetVisibility() string { return *c.Visibility } +// GetTagger returns the Tagger field. +func (c *CreateTag) GetTagger() *CommitAuthor { + if c == nil { + return nil + } + return c.Tagger +} + // GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise. func (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool { if c == nil || c.CanAdminsBypass == nil { @@ -5998,38 +6286,6 @@ func (c *CreateUpdateEnvironment) GetWaitTimer() int { return *c.WaitTimer } -// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetRepositoryID() int64 { - if c == nil || c.RepositoryID == nil { - return 0 - } - return *c.RepositoryID -} - -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetScope() string { - if c == nil || c.Scope == nil { - return "" - } - return *c.Scope -} - -// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field. -func (c *CreateUpdateRequiredWorkflowOptions) GetSelectedRepositoryIDs() *SelectedRepoIDs { - if c == nil { - return nil - } - return c.SelectedRepositoryIDs -} - -// GetWorkflowFilePath returns the WorkflowFilePath field if it's non-nil, zero value otherwise. -func (c *CreateUpdateRequiredWorkflowOptions) GetWorkflowFilePath() string { - if c == nil || c.WorkflowFilePath == nil { - return "" - } - return *c.WorkflowFilePath -} - // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (c *CreateUserRequest) GetEmail() string { if c == nil || c.Email == nil { @@ -6046,6 +6302,14 @@ func (c *CreateUserRequest) GetSuspended() bool { return *c.Suspended } +// GetInputs returns the Inputs map if it's non-nil, an empty map otherwise. +func (c *CreateWorkflowDispatchEventRequest) GetInputs() map[string]any { + if c == nil || c.Inputs == nil { + return map[string]any{} + } + return c.Inputs +} + // GetCreated returns the Created field if it's non-nil, zero value otherwise. func (c *CreationInfo) GetCreated() Timestamp { if c == nil || c.Created == nil { @@ -6862,6 +7126,14 @@ func (d *DependabotSecurityAdvisory) GetDescription() string { return *d.Description } +// GetEPSS returns the EPSS field. +func (d *DependabotSecurityAdvisory) GetEPSS() *AdvisoryEPSS { + if d == nil { + return nil + } + return d.EPSS +} + // GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise. func (d *DependabotSecurityAdvisory) GetGHSAID() string { if d == nil || d.GHSAID == nil { @@ -6966,6 +7238,14 @@ func (d *DependencyGraphSnapshot) GetJob() *DependencyGraphSnapshotJob { return d.Job } +// GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise. +func (d *DependencyGraphSnapshot) GetMetadata() map[string]any { + if d == nil || d.Metadata == nil { + return map[string]any{} + } + return d.Metadata +} + // GetRef returns the Ref field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshot) GetRef() string { if d == nil || d.Ref == nil { @@ -7070,6 +7350,14 @@ func (d *DependencyGraphSnapshotManifest) GetFile() *DependencyGraphSnapshotMani return d.File } +// GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise. +func (d *DependencyGraphSnapshotManifest) GetMetadata() map[string]any { + if d == nil || d.Metadata == nil { + return map[string]any{} + } + return d.Metadata +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshotManifest) GetName() string { if d == nil || d.Name == nil { @@ -7086,6 +7374,14 @@ func (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string { return *d.SourceLocation } +// GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise. +func (d *DependencyGraphSnapshotResolvedDependency) GetMetadata() map[string]any { + if d == nil || d.Metadata == nil { + return map[string]any{} + } + return d.Metadata +} + // GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. func (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string { if d == nil || d.PackageURL == nil { @@ -9134,6 +9430,38 @@ func (f *Feeds) GetUserURL() string { return *f.UserURL } +// GetFieldName returns the FieldName field if it's non-nil, zero value otherwise. +func (f *FieldValue) GetFieldName() string { + if f == nil || f.FieldName == nil { + return "" + } + return *f.FieldName +} + +// GetFieldNodeID returns the FieldNodeID field if it's non-nil, zero value otherwise. +func (f *FieldValue) GetFieldNodeID() string { + if f == nil || f.FieldNodeID == nil { + return "" + } + return *f.FieldNodeID +} + +// GetFieldType returns the FieldType field if it's non-nil, zero value otherwise. +func (f *FieldValue) GetFieldType() string { + if f == nil || f.FieldType == nil { + return "" + } + return *f.FieldType +} + +// GetProjectNumber returns the ProjectNumber field if it's non-nil, zero value otherwise. +func (f *FieldValue) GetProjectNumber() int64 { + if f == nil || f.ProjectNumber == nil { + return 0 + } + return *f.ProjectNumber +} + // GetIdentifier returns the Identifier field if it's non-nil, zero value otherwise. func (f *FirstPatchedVersion) GetIdentifier() string { if f == nil || f.Identifier == nil { @@ -9942,6 +10270,14 @@ func (h *Hook) GetID() int64 { return *h.ID } +// GetLastResponse returns the LastResponse map if it's non-nil, an empty map otherwise. +func (h *Hook) GetLastResponse() map[string]any { + if h == nil || h.LastResponse == nil { + return map[string]any{} + } + return h.LastResponse +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (h *Hook) GetName() string { if h == nil || h.Name == nil { @@ -10182,26 +10518,154 @@ func (h *HookStats) GetTotalHooks() int { return *h.TotalHooks } -// GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise. -func (i *IDPGroup) GetGroupDescription() string { - if i == nil || i.GroupDescription == nil { - return "" +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetID() int64 { + if h == nil || h.ID == nil { + return 0 } - return *i.GroupDescription + return *h.ID } -// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise. -func (i *IDPGroup) GetGroupID() string { - if i == nil || i.GroupID == nil { - return "" +// GetImageDetails returns the ImageDetails field. +func (h *HostedRunner) GetImageDetails() *HostedRunnerImageDetail { + if h == nil { + return nil } - return *i.GroupID + return h.ImageDetails } -// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise. -func (i *IDPGroup) GetGroupName() string { - if i == nil || i.GroupName == nil { - return "" +// GetLastActiveOn returns the LastActiveOn field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetLastActiveOn() Timestamp { + if h == nil || h.LastActiveOn == nil { + return Timestamp{} + } + return *h.LastActiveOn +} + +// GetMachineSizeDetails returns the MachineSizeDetails field. +func (h *HostedRunner) GetMachineSizeDetails() *HostedRunnerMachineSpec { + if h == nil { + return nil + } + return h.MachineSizeDetails +} + +// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetMaximumRunners() int64 { + if h == nil || h.MaximumRunners == nil { + return 0 + } + return *h.MaximumRunners +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetName() string { + if h == nil || h.Name == nil { + return "" + } + return *h.Name +} + +// GetPlatform returns the Platform field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetPlatform() string { + if h == nil || h.Platform == nil { + return "" + } + return *h.Platform +} + +// GetPublicIPEnabled returns the PublicIPEnabled field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetPublicIPEnabled() bool { + if h == nil || h.PublicIPEnabled == nil { + return false + } + return *h.PublicIPEnabled +} + +// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetRunnerGroupID() int64 { + if h == nil || h.RunnerGroupID == nil { + return 0 + } + return *h.RunnerGroupID +} + +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (h *HostedRunner) GetStatus() string { + if h == nil || h.Status == nil { + return "" + } + return *h.Status +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetDisplayName() string { + if h == nil || h.DisplayName == nil { + return "" + } + return *h.DisplayName +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetID() string { + if h == nil || h.ID == nil { + return "" + } + return *h.ID +} + +// GetSizeGB returns the SizeGB field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSizeGB() int64 { + if h == nil || h.SizeGB == nil { + return 0 + } + return *h.SizeGB +} + +// GetSource returns the Source field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetSource() string { + if h == nil || h.Source == nil { + return "" + } + return *h.Source +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (h *HostedRunnerImageDetail) GetVersion() string { + if h == nil || h.Version == nil { + return "" + } + return *h.Version +} + +// GetPublicIPs returns the PublicIPs field. +func (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage { + if h == nil { + return nil + } + return h.PublicIPs +} + +// GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise. +func (i *IDPGroup) GetGroupDescription() string { + if i == nil || i.GroupDescription == nil { + return "" + } + return *i.GroupDescription +} + +// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise. +func (i *IDPGroup) GetGroupID() string { + if i == nil || i.GroupID == nil { + return "" + } + return *i.GroupID +} + +// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise. +func (i *IDPGroup) GetGroupName() string { + if i == nil || i.GroupName == nil { + return "" } return *i.GroupName } @@ -12278,6 +12742,14 @@ func (i *IssueRequest) GetTitle() string { return *i.Title } +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (i *IssueRequest) GetType() string { + if i == nil || i.Type == nil { + return "" + } + return *i.Type +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (i *IssuesEvent) GetAction() string { if i == nil || i.Action == nil { @@ -13127,7 +13599,7 @@ func (l *ListCheckRunsResults) GetTotal() int { } // GetAppID returns the AppID field if it's non-nil, zero value otherwise. -func (l *ListCheckSuiteOptions) GetAppID() int { +func (l *ListCheckSuiteOptions) GetAppID() int64 { if l == nil || l.AppID == nil { return 0 } @@ -13286,6 +13758,38 @@ func (l *ListRunnersOptions) GetName() string { return *l.Name } +// GetCount returns the Count field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetCount() int { + if l == nil || l.Count == nil { + return 0 + } + return *l.Count +} + +// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetExcludedAttributes() string { + if l == nil || l.ExcludedAttributes == nil { + return "" + } + return *l.ExcludedAttributes +} + +// GetFilter returns the Filter field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetFilter() string { + if l == nil || l.Filter == nil { + return "" + } + return *l.Filter +} + +// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise. +func (l *ListSCIMProvisionedGroupsForEnterpriseOptions) GetStartIndex() int { + if l == nil || l.StartIndex == nil { + return 0 + } + return *l.StartIndex +} + // GetCount returns the Count field if it's non-nil, zero value otherwise. func (l *ListSCIMProvisionedIdentitiesOptions) GetCount() int { if l == nil || l.Count == nil { @@ -14110,6 +14614,14 @@ func (m *MergeGroupEvent) GetOrg() *Organization { return m.Org } +// GetReason returns the Reason field if it's non-nil, zero value otherwise. +func (m *MergeGroupEvent) GetReason() string { + if m == nil || m.Reason == nil { + return "" + } + return *m.Reason +} + // GetRepo returns the Repo field. func (m *MergeGroupEvent) GetRepo() *Repository { if m == nil { @@ -14582,6 +15094,102 @@ func (m *MostRecentInstance) GetState() string { return *m.State } +// GetComputeService returns the ComputeService field. +func (n *NetworkConfiguration) GetComputeService() *ComputeService { + if n == nil { + return nil + } + return n.ComputeService +} + +// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetCreatedOn() Timestamp { + if n == nil || n.CreatedOn == nil { + return Timestamp{} + } + return *n.CreatedOn +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetID() string { + if n == nil || n.ID == nil { + return "" + } + return *n.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkConfiguration) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetComputeService returns the ComputeService field. +func (n *NetworkConfigurationRequest) GetComputeService() *ComputeService { + if n == nil { + return nil + } + return n.ComputeService +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkConfigurationRequest) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. +func (n *NetworkConfigurations) GetTotalCount() int64 { + if n == nil || n.TotalCount == nil { + return 0 + } + return *n.TotalCount +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetID() string { + if n == nil || n.ID == nil { + return "" + } + return *n.ID +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetName() string { + if n == nil || n.Name == nil { + return "" + } + return *n.Name +} + +// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetNetworkConfigurationID() string { + if n == nil || n.NetworkConfigurationID == nil { + return "" + } + return *n.NetworkConfigurationID +} + +// GetRegion returns the Region field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetRegion() string { + if n == nil || n.Region == nil { + return "" + } + return *n.Region +} + +// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise. +func (n *NetworkSettingsResource) GetSubnetID() string { + if n == nil || n.SubnetID == nil { + return "" + } + return *n.SubnetID +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (n *NewPullRequest) GetBase() string { if n == nil || n.Base == nil { @@ -14950,6 +15558,14 @@ func (o *Organization) GetDefaultRepoSettings() string { return *o.DefaultRepoSettings } +// GetDefaultRepositoryBranch returns the DefaultRepositoryBranch field if it's non-nil, zero value otherwise. +func (o *Organization) GetDefaultRepositoryBranch() string { + if o == nil || o.DefaultRepositoryBranch == nil { + return "" + } + return *o.DefaultRepositoryBranch +} + // GetDependabotAlertsEnabledForNewRepos returns the DependabotAlertsEnabledForNewRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetDependabotAlertsEnabledForNewRepos() bool { if o == nil || o.DependabotAlertsEnabledForNewRepos == nil { @@ -14990,6 +15606,14 @@ func (o *Organization) GetDiskUsage() int { return *o.DiskUsage } +// GetDisplayCommenterFullNameSettingEnabled returns the DisplayCommenterFullNameSettingEnabled field if it's non-nil, zero value otherwise. +func (o *Organization) GetDisplayCommenterFullNameSettingEnabled() bool { + if o == nil || o.DisplayCommenterFullNameSettingEnabled == nil { + return false + } + return *o.DisplayCommenterFullNameSettingEnabled +} + // GetEmail returns the Email field if it's non-nil, zero value otherwise. func (o *Organization) GetEmail() string { if o == nil || o.Email == nil { @@ -15102,6 +15726,14 @@ func (o *Organization) GetMembersAllowedRepositoryCreationType() string { return *o.MembersAllowedRepositoryCreationType } +// GetMembersCanChangeRepoVisibility returns the MembersCanChangeRepoVisibility field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanChangeRepoVisibility() bool { + if o == nil || o.MembersCanChangeRepoVisibility == nil { + return false + } + return *o.MembersCanChangeRepoVisibility +} + // GetMembersCanCreateInternalRepos returns the MembersCanCreateInternalRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetMembersCanCreateInternalRepos() bool { if o == nil || o.MembersCanCreateInternalRepos == nil { @@ -15158,6 +15790,30 @@ func (o *Organization) GetMembersCanCreateRepos() bool { return *o.MembersCanCreateRepos } +// GetMembersCanCreateTeams returns the MembersCanCreateTeams field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanCreateTeams() bool { + if o == nil || o.MembersCanCreateTeams == nil { + return false + } + return *o.MembersCanCreateTeams +} + +// GetMembersCanDeleteIssues returns the MembersCanDeleteIssues field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanDeleteIssues() bool { + if o == nil || o.MembersCanDeleteIssues == nil { + return false + } + return *o.MembersCanDeleteIssues +} + +// GetMembersCanDeleteRepositories returns the MembersCanDeleteRepositories field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanDeleteRepositories() bool { + if o == nil || o.MembersCanDeleteRepositories == nil { + return false + } + return *o.MembersCanDeleteRepositories +} + // GetMembersCanForkPrivateRepos returns the MembersCanForkPrivateRepos field if it's non-nil, zero value otherwise. func (o *Organization) GetMembersCanForkPrivateRepos() bool { if o == nil || o.MembersCanForkPrivateRepos == nil { @@ -15166,6 +15822,22 @@ func (o *Organization) GetMembersCanForkPrivateRepos() bool { return *o.MembersCanForkPrivateRepos } +// GetMembersCanInviteOutsideCollaborators returns the MembersCanInviteOutsideCollaborators field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanInviteOutsideCollaborators() bool { + if o == nil || o.MembersCanInviteOutsideCollaborators == nil { + return false + } + return *o.MembersCanInviteOutsideCollaborators +} + +// GetMembersCanViewDependencyInsights returns the MembersCanViewDependencyInsights field if it's non-nil, zero value otherwise. +func (o *Organization) GetMembersCanViewDependencyInsights() bool { + if o == nil || o.MembersCanViewDependencyInsights == nil { + return false + } + return *o.MembersCanViewDependencyInsights +} + // GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise. func (o *Organization) GetMembersURL() string { if o == nil || o.MembersURL == nil { @@ -15238,6 +15910,14 @@ func (o *Organization) GetPublicRepos() int { return *o.PublicRepos } +// GetReadersCanCreateDiscussions returns the ReadersCanCreateDiscussions field if it's non-nil, zero value otherwise. +func (o *Organization) GetReadersCanCreateDiscussions() bool { + if o == nil || o.ReadersCanCreateDiscussions == nil { + return false + } + return *o.ReadersCanCreateDiscussions +} + // GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise. func (o *Organization) GetReposURL() string { if o == nil || o.ReposURL == nil { @@ -15438,124 +16118,36 @@ func (o *OrgBlockEvent) GetSender() *User { return o.Sender } -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetCreatedAt() Timestamp { - if o == nil || o.CreatedAt == nil { - return Timestamp{} +// GetDisabledOrgs returns the DisabledOrgs field if it's non-nil, zero value otherwise. +func (o *OrgStats) GetDisabledOrgs() int { + if o == nil || o.DisabledOrgs == nil { + return 0 } - return *o.CreatedAt + return *o.DisabledOrgs } -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetID() int64 { - if o == nil || o.ID == nil { +// GetTotalOrgs returns the TotalOrgs field if it's non-nil, zero value otherwise. +func (o *OrgStats) GetTotalOrgs() int { + if o == nil || o.TotalOrgs == nil { return 0 } - return *o.ID + return *o.TotalOrgs } -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetName() string { - if o == nil || o.Name == nil { - return "" +// GetTotalTeamMembers returns the TotalTeamMembers field if it's non-nil, zero value otherwise. +func (o *OrgStats) GetTotalTeamMembers() int { + if o == nil || o.TotalTeamMembers == nil { + return 0 } - return *o.Name + return *o.TotalTeamMembers } -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetPath() string { - if o == nil || o.Path == nil { - return "" +// GetTotalTeams returns the TotalTeams field if it's non-nil, zero value otherwise. +func (o *OrgStats) GetTotalTeams() int { + if o == nil || o.TotalTeams == nil { + return 0 } - return *o.Path -} - -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetRef() string { - if o == nil || o.Ref == nil { - return "" - } - return *o.Ref -} - -// GetRepository returns the Repository field. -func (o *OrgRequiredWorkflow) GetRepository() *Repository { - if o == nil { - return nil - } - return o.Repository -} - -// GetScope returns the Scope field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetScope() string { - if o == nil || o.Scope == nil { - return "" - } - return *o.Scope -} - -// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetSelectedRepositoriesURL() string { - if o == nil || o.SelectedRepositoriesURL == nil { - return "" - } - return *o.SelectedRepositoriesURL -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetState() string { - if o == nil || o.State == nil { - return "" - } - return *o.State -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflow) GetUpdatedAt() Timestamp { - if o == nil || o.UpdatedAt == nil { - return Timestamp{} - } - return *o.UpdatedAt -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (o *OrgRequiredWorkflows) GetTotalCount() int { - if o == nil || o.TotalCount == nil { - return 0 - } - return *o.TotalCount -} - -// GetDisabledOrgs returns the DisabledOrgs field if it's non-nil, zero value otherwise. -func (o *OrgStats) GetDisabledOrgs() int { - if o == nil || o.DisabledOrgs == nil { - return 0 - } - return *o.DisabledOrgs -} - -// GetTotalOrgs returns the TotalOrgs field if it's non-nil, zero value otherwise. -func (o *OrgStats) GetTotalOrgs() int { - if o == nil || o.TotalOrgs == nil { - return 0 - } - return *o.TotalOrgs -} - -// GetTotalTeamMembers returns the TotalTeamMembers field if it's non-nil, zero value otherwise. -func (o *OrgStats) GetTotalTeamMembers() int { - if o == nil || o.TotalTeamMembers == nil { - return 0 - } - return *o.TotalTeamMembers -} - -// GetTotalTeams returns the TotalTeams field if it's non-nil, zero value otherwise. -func (o *OrgStats) GetTotalTeams() int { - if o == nil || o.TotalTeams == nil { - return 0 - } - return *o.TotalTeams + return *o.TotalTeams } // GetOrg returns the Org field. @@ -15582,6 +16174,22 @@ func (p *Package) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *Package) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise. +func (p *Package) GetEcosystem() string { + if p == nil || p.Ecosystem == nil { + return "" + } + return *p.Ecosystem +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (p *Package) GetHTMLURL() string { if p == nil || p.HTMLURL == nil { @@ -15606,6 +16214,14 @@ func (p *Package) GetName() string { return *p.Name } +// GetNamespace returns the Namespace field if it's non-nil, zero value otherwise. +func (p *Package) GetNamespace() string { + if p == nil || p.Namespace == nil { + return "" + } + return *p.Namespace +} + // GetOwner returns the Owner field. func (p *Package) GetOwner() *User { if p == nil { @@ -15726,6 +16342,46 @@ func (p *PackageEvent) GetSender() *User { return p.Sender } +// GetLabels returns the Labels map if it's non-nil, an empty map otherwise. +func (p *PackageEventContainerMetadata) GetLabels() map[string]any { + if p == nil || p.Labels == nil { + return map[string]any{} + } + return p.Labels +} + +// GetManifest returns the Manifest map if it's non-nil, an empty map otherwise. +func (p *PackageEventContainerMetadata) GetManifest() map[string]any { + if p == nil || p.Manifest == nil { + return map[string]any{} + } + return p.Manifest +} + +// GetTag returns the Tag field. +func (p *PackageEventContainerMetadata) GetTag() *PackageEventContainerMetadataTag { + if p == nil { + return nil + } + return p.Tag +} + +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (p *PackageEventContainerMetadataTag) GetDigest() string { + if p == nil || p.Digest == nil { + return "" + } + return *p.Digest +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageEventContainerMetadataTag) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + // GetAuthor returns the Author field. func (p *PackageFile) GetAuthor() *User { if p == nil { @@ -15862,6 +16518,262 @@ func (p *PackageMetadata) GetPackageType() string { return *p.PackageType } +// GetAuthor returns the Author map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetAuthor() map[string]string { + if p == nil || p.Author == nil { + return map[string]string{} + } + return p.Author +} + +// GetBin returns the Bin map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetBin() map[string]any { + if p == nil || p.Bin == nil { + return map[string]any{} + } + return p.Bin +} + +// GetBugs returns the Bugs map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetBugs() map[string]string { + if p == nil || p.Bugs == nil { + return map[string]string{} + } + return p.Bugs +} + +// GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetCommitOID() string { + if p == nil || p.CommitOID == nil { + return "" + } + return *p.CommitOID +} + +// GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetDeletedByID() int64 { + if p == nil || p.DeletedByID == nil { + return 0 + } + return *p.DeletedByID +} + +// GetDependencies returns the Dependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDependencies() map[string]string { + if p == nil || p.Dependencies == nil { + return map[string]string{} + } + return p.Dependencies +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + +// GetDevDependencies returns the DevDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDevDependencies() map[string]string { + if p == nil || p.DevDependencies == nil { + return map[string]string{} + } + return p.DevDependencies +} + +// GetDirectories returns the Directories map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDirectories() map[string]string { + if p == nil || p.Directories == nil { + return map[string]string{} + } + return p.Directories +} + +// GetDist returns the Dist map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetDist() map[string]string { + if p == nil || p.Dist == nil { + return map[string]string{} + } + return p.Dist +} + +// GetEngines returns the Engines map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetEngines() map[string]string { + if p == nil || p.Engines == nil { + return map[string]string{} + } + return p.Engines +} + +// GetGitHead returns the GitHead field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetGitHead() string { + if p == nil || p.GitHead == nil { + return "" + } + return *p.GitHead +} + +// GetHasShrinkwrap returns the HasShrinkwrap field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetHasShrinkwrap() bool { + if p == nil || p.HasShrinkwrap == nil { + return false + } + return *p.HasShrinkwrap +} + +// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetHomepage() string { + if p == nil || p.Homepage == nil { + return "" + } + return *p.Homepage +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetID() string { + if p == nil || p.ID == nil { + return "" + } + return *p.ID +} + +// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetInstallationCommand() string { + if p == nil || p.InstallationCommand == nil { + return "" + } + return *p.InstallationCommand +} + +// GetLicense returns the License field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetLicense() string { + if p == nil || p.License == nil { + return "" + } + return *p.License +} + +// GetMain returns the Main field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetMain() string { + if p == nil || p.Main == nil { + return "" + } + return *p.Main +} + +// GetMan returns the Man map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetMan() map[string]any { + if p == nil || p.Man == nil { + return map[string]any{} + } + return p.Man +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetNodeVersion returns the NodeVersion field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNodeVersion() string { + if p == nil || p.NodeVersion == nil { + return "" + } + return *p.NodeVersion +} + +// GetNPMUser returns the NPMUser field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNPMUser() string { + if p == nil || p.NPMUser == nil { + return "" + } + return *p.NPMUser +} + +// GetNPMVersion returns the NPMVersion field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetNPMVersion() string { + if p == nil || p.NPMVersion == nil { + return "" + } + return *p.NPMVersion +} + +// GetOptionalDependencies returns the OptionalDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string { + if p == nil || p.OptionalDependencies == nil { + return map[string]string{} + } + return p.OptionalDependencies +} + +// GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetPeerDependencies() map[string]string { + if p == nil || p.PeerDependencies == nil { + return map[string]string{} + } + return p.PeerDependencies +} + +// GetPublishedViaActions returns the PublishedViaActions field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetPublishedViaActions() bool { + if p == nil || p.PublishedViaActions == nil { + return false + } + return *p.PublishedViaActions +} + +// GetReadme returns the Readme field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetReadme() string { + if p == nil || p.Readme == nil { + return "" + } + return *p.Readme +} + +// GetReleaseID returns the ReleaseID field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetReleaseID() int64 { + if p == nil || p.ReleaseID == nil { + return 0 + } + return *p.ReleaseID +} + +// GetRepository returns the Repository map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetRepository() map[string]string { + if p == nil || p.Repository == nil { + return map[string]string{} + } + return p.Repository +} + +// GetScripts returns the Scripts map if it's non-nil, an empty map otherwise. +func (p *PackageNPMMetadata) GetScripts() map[string]any { + if p == nil || p.Scripts == nil { + return map[string]any{} + } + return p.Scripts +} + +// GetVersion returns the Version field if it's non-nil, zero value otherwise. +func (p *PackageNPMMetadata) GetVersion() string { + if p == nil || p.Version == nil { + return "" + } + return *p.Version +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageNugetMetadata) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + // GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise. func (p *PackageRegistry) GetAboutURL() string { if p == nil || p.AboutURL == nil { @@ -15998,14 +16910,6 @@ func (p *PackageVersion) GetAuthor() *User { return p.Author } -// GetBody returns the Body field if it's non-nil, zero value otherwise. -func (p *PackageVersion) GetBody() string { - if p == nil || p.Body == nil { - return "" - } - return *p.Body -} - // GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetBodyHTML() string { if p == nil || p.BodyHTML == nil { @@ -16014,6 +16918,14 @@ func (p *PackageVersion) GetBodyHTML() string { return *p.BodyHTML } +// GetContainerMetadata returns the ContainerMetadata field. +func (p *PackageVersion) GetContainerMetadata() *PackageEventContainerMetadata { + if p == nil { + return nil + } + return p.ContainerMetadata +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetCreatedAt() Timestamp { if p == nil || p.CreatedAt == nil { @@ -16022,6 +16934,22 @@ func (p *PackageVersion) GetCreatedAt() Timestamp { return *p.CreatedAt } +// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDeletedAt() Timestamp { + if p == nil || p.DeletedAt == nil { + return Timestamp{} + } + return *p.DeletedAt +} + +// GetDescription returns the Description field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetDescription() string { + if p == nil || p.Description == nil { + return "" + } + return *p.Description +} + // GetDraft returns the Draft field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetDraft() bool { if p == nil || p.Draft == nil { @@ -16054,6 +16982,14 @@ func (p *PackageVersion) GetInstallationCommand() string { return *p.InstallationCommand } +// GetLicense returns the License field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetLicense() string { + if p == nil || p.License == nil { + return "" + } + return *p.License +} + // GetManifest returns the Manifest field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetManifest() string { if p == nil || p.Manifest == nil { @@ -16062,14 +16998,6 @@ func (p *PackageVersion) GetManifest() string { return *p.Manifest } -// GetMetadata returns the Metadata field. -func (p *PackageVersion) GetMetadata() *PackageMetadata { - if p == nil { - return nil - } - return p.Metadata -} - // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetName() string { if p == nil || p.Name == nil { @@ -16078,6 +17006,14 @@ func (p *PackageVersion) GetName() string { return *p.Name } +// GetNPMMetadata returns the NPMMetadata field. +func (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata { + if p == nil { + return nil + } + return p.NPMMetadata +} + // GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPackageHTMLURL() string { if p == nil || p.PackageHTMLURL == nil { @@ -16086,6 +17022,14 @@ func (p *PackageVersion) GetPackageHTMLURL() string { return *p.PackageHTMLURL } +// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetPackageURL() string { + if p == nil || p.PackageURL == nil { + return "" + } + return *p.PackageURL +} + // GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetPrerelease() bool { if p == nil || p.Prerelease == nil { @@ -16102,6 +17046,22 @@ func (p *PackageVersion) GetRelease() *PackageRelease { return p.Release } +// GetRubyMetadata returns the RubyMetadata map if it's non-nil, an empty map otherwise. +func (p *PackageVersion) GetRubyMetadata() map[string]any { + if p == nil || p.RubyMetadata == nil { + return map[string]any{} + } + return p.RubyMetadata +} + +// GetSourceURL returns the SourceURL field if it's non-nil, zero value otherwise. +func (p *PackageVersion) GetSourceURL() string { + if p == nil || p.SourceURL == nil { + return "" + } + return *p.SourceURL +} + // GetSummary returns the Summary field if it's non-nil, zero value otherwise. func (p *PackageVersion) GetSummary() string { if p == nil || p.Summary == nil { @@ -16158,6 +17118,78 @@ func (p *PackageVersion) GetVersion() string { return *p.Version } +// GetInfo returns the Info field. +func (p *PackageVersionBody) GetInfo() *PackageVersionBodyInfo { + if p == nil { + return nil + } + return p.Info +} + +// GetRepo returns the Repo field. +func (p *PackageVersionBody) GetRepo() *Repository { + if p == nil { + return nil + } + return p.Repo +} + +// GetCollection returns the Collection field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetCollection() bool { + if p == nil || p.Collection == nil { + return false + } + return *p.Collection +} + +// GetMode returns the Mode field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetMode() int64 { + if p == nil || p.Mode == nil { + return 0 + } + return *p.Mode +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetName() string { + if p == nil || p.Name == nil { + return "" + } + return *p.Name +} + +// GetOID returns the OID field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetOID() string { + if p == nil || p.OID == nil { + return "" + } + return *p.OID +} + +// GetPath returns the Path field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetPath() string { + if p == nil || p.Path == nil { + return "" + } + return *p.Path +} + +// GetSize returns the Size field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetSize() int64 { + if p == nil || p.Size == nil { + return 0 + } + return *p.Size +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (p *PackageVersionBodyInfo) GetType() string { + if p == nil || p.Type == nil { + return "" + } + return *p.Type +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *Page) GetAction() string { if p == nil || p.Action == nil { @@ -16734,6 +17766,38 @@ func (p *PagesUpdate) GetSource() *PagesSource { return p.Source } +// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetBuildType() string { + if p == nil || p.BuildType == nil { + return "" + } + return *p.BuildType +} + +// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetHTTPSEnforced() bool { + if p == nil || p.HTTPSEnforced == nil { + return false + } + return *p.HTTPSEnforced +} + +// GetPublic returns the Public field if it's non-nil, zero value otherwise. +func (p *PagesUpdateWithoutCNAME) GetPublic() bool { + if p == nil || p.Public == nil { + return false + } + return *p.Public +} + +// GetSource returns the Source field. +func (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource { + if p == nil { + return nil + } + return p.Source +} + // GetName returns the Name field if it's non-nil, zero value otherwise. func (p *PatternRuleParameters) GetName() string { if p == nil || p.Name == nil { @@ -17646,6 +18710,14 @@ func (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt { return p.ArchivedAt } +// GetFieldValue returns the FieldValue field. +func (p *ProjectV2ItemChange) GetFieldValue() *FieldValue { + if p == nil { + return nil + } + return p.FieldValue +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *ProjectV2ItemEvent) GetAction() string { if p == nil || p.Action == nil { @@ -17910,6 +18982,14 @@ func (p *ProtectionChanges) GetRequiredStatusChecksEnforcementLevel() *RequiredS return p.RequiredStatusChecksEnforcementLevel } +// GetRequireLastPushApproval returns the RequireLastPushApproval field. +func (p *ProtectionChanges) GetRequireLastPushApproval() *RequireLastPushApprovalChanges { + if p == nil { + return nil + } + return p.RequireLastPushApproval +} + // GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field. func (p *ProtectionChanges) GetSignatureRequirementEnforcementLevel() *SignatureRequirementEnforcementLevelChanges { if p == nil { @@ -19310,6 +20390,14 @@ func (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread { return p.Thread } +// GetAutomaticCopilotCodeReviewEnabled returns the AutomaticCopilotCodeReviewEnabled field if it's non-nil, zero value otherwise. +func (p *PullRequestRuleParameters) GetAutomaticCopilotCodeReviewEnabled() bool { + if p == nil || p.AutomaticCopilotCodeReviewEnabled == nil { + return false + } + return *p.AutomaticCopilotCodeReviewEnabled +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (p *PullRequestTargetEvent) GetAction() string { if p == nil || p.Action == nil { @@ -19710,6 +20798,14 @@ 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]any { + if p == nil || p.CustomProperties == nil { + return map[string]any{} + } + 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 { @@ -20062,6 +21158,14 @@ func (r *Reaction) GetContent() string { return *r.Content } +// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. +func (r *Reaction) 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 *Reaction) GetID() int64 { if r == nil || r.ID == nil { @@ -20203,39 +21307,95 @@ func (r *ReferencedWorkflow) GetPath() string { if r == nil || r.Path == nil { return "" } - return *r.Path + return *r.Path +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (r *ReferencedWorkflow) GetRef() string { + if r == nil || r.Ref == nil { + return "" + } + return *r.Ref +} + +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (r *ReferencedWorkflow) GetSHA() string { + if r == nil || r.SHA == nil { + return "" + } + return *r.SHA +} + +// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. +func (r *RegistrationToken) GetExpiresAt() Timestamp { + if r == nil || r.ExpiresAt == nil { + return Timestamp{} + } + return *r.ExpiresAt +} + +// GetToken returns the Token field if it's non-nil, zero value otherwise. +func (r *RegistrationToken) GetToken() string { + if r == nil || r.Token == nil { + return "" + } + return *r.Token +} + +// GetAction returns the Action field if it's non-nil, zero value otherwise. +func (r *RegistryPackageEvent) GetAction() string { + if r == nil || r.Action == nil { + return "" + } + return *r.Action +} + +// GetEnterprise returns the Enterprise field. +func (r *RegistryPackageEvent) GetEnterprise() *Enterprise { + if r == nil { + return nil + } + return r.Enterprise +} + +// GetInstallation returns the Installation field. +func (r *RegistryPackageEvent) GetInstallation() *Installation { + if r == nil { + return nil + } + return r.Installation } -// GetRef returns the Ref field if it's non-nil, zero value otherwise. -func (r *ReferencedWorkflow) GetRef() string { - if r == nil || r.Ref == nil { - return "" +// GetOrganization returns the Organization field. +func (r *RegistryPackageEvent) GetOrganization() *Organization { + if r == nil { + return nil } - return *r.Ref + return r.Organization } -// GetSHA returns the SHA field if it's non-nil, zero value otherwise. -func (r *ReferencedWorkflow) GetSHA() string { - if r == nil || r.SHA == nil { - return "" +// GetRegistryPackage returns the RegistryPackage field. +func (r *RegistryPackageEvent) GetRegistryPackage() *Package { + if r == nil { + return nil } - return *r.SHA + return r.RegistryPackage } -// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise. -func (r *RegistrationToken) GetExpiresAt() Timestamp { - if r == nil || r.ExpiresAt == nil { - return Timestamp{} +// GetRepository returns the Repository field. +func (r *RegistryPackageEvent) GetRepository() *Repository { + if r == nil { + return nil } - return *r.ExpiresAt + return r.Repository } -// GetToken returns the Token field if it's non-nil, zero value otherwise. -func (r *RegistrationToken) GetToken() string { - if r == nil || r.Token == nil { - return "" +// GetSender returns the Sender field. +func (r *RegistryPackageEvent) GetSender() *User { + if r == nil { + return nil } - return *r.Token + return r.Sender } // GetBrowserDownloadURL returns the BrowserDownloadURL field if it's non-nil, zero value otherwise. @@ -20262,6 +21422,14 @@ func (r *ReleaseAsset) GetCreatedAt() Timestamp { return *r.CreatedAt } +// GetDigest returns the Digest field if it's non-nil, zero value otherwise. +func (r *ReleaseAsset) GetDigest() string { + if r == nil || r.Digest == nil { + return "" + } + return *r.Digest +} + // GetDownloadCount returns the DownloadCount field if it's non-nil, zero value otherwise. func (r *ReleaseAsset) GetDownloadCount() int { if r == nil || r.DownloadCount == nil { @@ -20606,102 +21774,6 @@ func (r *RepoName) GetFrom() string { return *r.From } -// GetBadgeURL returns the BadgeURL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetBadgeURL() string { - if r == nil || r.BadgeURL == nil { - return "" - } - return *r.BadgeURL -} - -// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetCreatedAt() Timestamp { - if r == nil || r.CreatedAt == nil { - return Timestamp{} - } - return *r.CreatedAt -} - -// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetHTMLURL() string { - if r == nil || r.HTMLURL == nil { - return "" - } - return *r.HTMLURL -} - -// GetID returns the ID field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetID() int64 { - if r == nil || r.ID == nil { - return 0 - } - return *r.ID -} - -// GetName returns the Name field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetName() string { - if r == nil || r.Name == nil { - return "" - } - return *r.Name -} - -// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetNodeID() string { - if r == nil || r.NodeID == nil { - return "" - } - return *r.NodeID -} - -// GetPath returns the Path field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetPath() string { - if r == nil || r.Path == nil { - return "" - } - return *r.Path -} - -// GetSourceRepository returns the SourceRepository field. -func (r *RepoRequiredWorkflow) GetSourceRepository() *Repository { - if r == nil { - return nil - } - return r.SourceRepository -} - -// GetState returns the State field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetState() string { - if r == nil || r.State == nil { - return "" - } - return *r.State -} - -// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetUpdatedAt() Timestamp { - if r == nil || r.UpdatedAt == nil { - return Timestamp{} - } - return *r.UpdatedAt -} - -// GetURL returns the URL field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflow) GetURL() string { - if r == nil || r.URL == nil { - return "" - } - return *r.URL -} - -// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. -func (r *RepoRequiredWorkflows) GetTotalCount() int { - if r == nil || r.TotalCount == nil { - return 0 - } - return *r.TotalCount -} - // GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise. func (r *RepositoriesSearchResult) GetIncompleteResults() bool { if r == nil || r.IncompleteResults == nil { @@ -20886,6 +21958,14 @@ 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]any { + if r == nil || r.CustomProperties == nil { + return map[string]any{} + } + 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 { @@ -21566,6 +22646,174 @@ func (r *RepositoryActiveCommitters) GetName() string { return *r.Name } +// GetActor returns the Actor field. +func (r *RepositoryActivity) GetActor() *RepositoryActor { + if r == nil { + return nil + } + return r.Actor +} + +// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise. +func (r *RepositoryActivity) GetTimestamp() Timestamp { + if r == nil || r.Timestamp == nil { + return Timestamp{} + } + return *r.Timestamp +} + +// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetAvatarURL() string { + if r == nil || r.AvatarURL == nil { + return "" + } + return *r.AvatarURL +} + +// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetEventsURL() string { + if r == nil || r.EventsURL == nil { + return "" + } + return *r.EventsURL +} + +// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetFollowersURL() string { + if r == nil || r.FollowersURL == nil { + return "" + } + return *r.FollowersURL +} + +// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetFollowingURL() string { + if r == nil || r.FollowingURL == nil { + return "" + } + return *r.FollowingURL +} + +// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetGistsURL() string { + if r == nil || r.GistsURL == nil { + return "" + } + return *r.GistsURL +} + +// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetGravatarID() string { + if r == nil || r.GravatarID == nil { + return "" + } + return *r.GravatarID +} + +// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetHTMLURL() string { + if r == nil || r.HTMLURL == nil { + return "" + } + return *r.HTMLURL +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetID() int64 { + if r == nil || r.ID == nil { + return 0 + } + return *r.ID +} + +// GetLogin returns the Login field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetLogin() string { + if r == nil || r.Login == nil { + return "" + } + return *r.Login +} + +// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetNodeID() string { + if r == nil || r.NodeID == nil { + return "" + } + return *r.NodeID +} + +// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetOrganizationsURL() string { + if r == nil || r.OrganizationsURL == nil { + return "" + } + return *r.OrganizationsURL +} + +// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetReceivedEventsURL() string { + if r == nil || r.ReceivedEventsURL == nil { + return "" + } + return *r.ReceivedEventsURL +} + +// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetReposURL() string { + if r == nil || r.ReposURL == nil { + return "" + } + return *r.ReposURL +} + +// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetSiteAdmin() bool { + if r == nil || r.SiteAdmin == nil { + return false + } + return *r.SiteAdmin +} + +// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetStarredURL() string { + if r == nil || r.StarredURL == nil { + return "" + } + return *r.StarredURL +} + +// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetSubscriptionsURL() string { + if r == nil || r.SubscriptionsURL == nil { + return "" + } + return *r.SubscriptionsURL +} + +// GetType returns the Type field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetType() string { + if r == nil || r.Type == nil { + return "" + } + return *r.Type +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetURL() string { + if r == nil || r.URL == nil { + return "" + } + return *r.URL +} + +// GetUserViewType returns the UserViewType field if it's non-nil, zero value otherwise. +func (r *RepositoryActor) GetUserViewType() string { + if r == nil || r.UserViewType == nil { + return "" + } + return *r.UserViewType +} + // GetConfiguration returns the Configuration field. func (r *RepositoryCodeSecurityConfiguration) GetConfiguration() *CodeSecurityConfiguration { if r == nil { @@ -22190,6 +23438,14 @@ func (r *RepositoryLicense) GetURL() string { return *r.URL } +// GetIncludesParents returns the IncludesParents field if it's non-nil, zero value otherwise. +func (r *RepositoryListRulesetsOptions) GetIncludesParents() bool { + if r == nil || r.IncludesParents == nil { + return false + } + return *r.IncludesParents +} + // GetBase returns the Base field if it's non-nil, zero value otherwise. func (r *RepositoryMergeRequest) GetBase() string { if r == nil || r.Base == nil { @@ -23334,12 +24590,12 @@ func (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool { 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 { - return 0 +// GetFrom returns the From field if it's non-nil, zero value otherwise. +func (r *RequireLastPushApprovalChanges) GetFrom() bool { + if r == nil || r.From == nil { + return false } - return *r.TotalCount + return *r.From } // GetNodeID returns the NodeID field if it's non-nil, zero value otherwise. @@ -24094,6 +25350,22 @@ func (s *SecretScanningAlert) GetCreatedAt() Timestamp { return *s.CreatedAt } +// GetFirstLocationDetected returns the FirstLocationDetected field. +func (s *SecretScanningAlert) GetFirstLocationDetected() *SecretScanningAlertLocationDetails { + if s == nil { + return nil + } + return s.FirstLocationDetected +} + +// GetHasMoreLocations returns the HasMoreLocations field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetHasMoreLocations() bool { + if s == nil || s.HasMoreLocations == nil { + return false + } + return *s.HasMoreLocations +} + // GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetHTMLURL() string { if s == nil || s.HTMLURL == nil { @@ -24102,6 +25374,14 @@ func (s *SecretScanningAlert) GetHTMLURL() string { return *s.HTMLURL } +// GetIsBase64Encoded returns the IsBase64Encoded field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetIsBase64Encoded() bool { + if s == nil || s.IsBase64Encoded == nil { + return false + } + return *s.IsBase64Encoded +} + // GetLocationsURL returns the LocationsURL field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetLocationsURL() string { if s == nil || s.LocationsURL == nil { @@ -24110,6 +25390,14 @@ func (s *SecretScanningAlert) GetLocationsURL() string { return *s.LocationsURL } +// GetMultiRepo returns the MultiRepo field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetMultiRepo() bool { + if s == nil || s.MultiRepo == nil { + return false + } + return *s.MultiRepo +} + // GetNumber returns the Number field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetNumber() int { if s == nil || s.Number == nil { @@ -24118,6 +25406,14 @@ func (s *SecretScanningAlert) GetNumber() int { return *s.Number } +// GetPubliclyLeaked returns the PubliclyLeaked field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPubliclyLeaked() bool { + if s == nil || s.PubliclyLeaked == nil { + return false + } + return *s.PubliclyLeaked +} + // GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise. func (s *SecretScanningAlert) GetPushProtectionBypassed() bool { if s == nil || s.PushProtectionBypassed == nil { @@ -24142,6 +25438,38 @@ func (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User { return s.PushProtectionBypassedBy } +// GetPushProtectionBypassRequestComment returns the PushProtectionBypassRequestComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestComment() string { + if s == nil || s.PushProtectionBypassRequestComment == nil { + return "" + } + return *s.PushProtectionBypassRequestComment +} + +// GetPushProtectionBypassRequestHTMLURL returns the PushProtectionBypassRequestHTMLURL field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestHTMLURL() string { + if s == nil || s.PushProtectionBypassRequestHTMLURL == nil { + return "" + } + return *s.PushProtectionBypassRequestHTMLURL +} + +// GetPushProtectionBypassRequestReviewer returns the PushProtectionBypassRequestReviewer field. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewer() *User { + if s == nil { + return nil + } + return s.PushProtectionBypassRequestReviewer +} + +// GetPushProtectionBypassRequestReviewerComment returns the PushProtectionBypassRequestReviewerComment field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment() string { + if s == nil || s.PushProtectionBypassRequestReviewerComment == nil { + return "" + } + return *s.PushProtectionBypassRequestReviewerComment +} + // GetRepository returns the Repository field. func (s *SecretScanningAlert) GetRepository() *Repository { if s == nil { @@ -24230,6 +25558,14 @@ func (s *SecretScanningAlert) GetURL() string { return *s.URL } +// GetValidity returns the Validity field if it's non-nil, zero value otherwise. +func (s *SecretScanningAlert) GetValidity() string { + if s == nil || s.Validity == nil { + return "" + } + return *s.Validity +} + // GetAction returns the Action field if it's non-nil, zero value otherwise. func (s *SecretScanningAlertEvent) GetAction() string { if s == nil || s.Action == nil { @@ -24454,6 +25790,134 @@ func (s *SecretScanningAlertUpdateOptions) GetResolutionComment() string { return *s.ResolutionComment } +// GetCustomPatternVersion returns the CustomPatternVersion field if it's non-nil, zero value otherwise. +func (s *SecretScanningCustomPatternSetting) GetCustomPatternVersion() string { + if s == nil || s.CustomPatternVersion == nil { + return "" + } + return *s.CustomPatternVersion +} + +// GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternConfigs) GetPatternConfigVersion() string { + if s == nil || s.PatternConfigVersion == nil { + return "" + } + return *s.PatternConfigVersion +} + +// GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternConfigsUpdate) GetPatternConfigVersion() string { + if s == nil || s.PatternConfigVersion == nil { + return "" + } + return *s.PatternConfigVersion +} + +// GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternConfigsUpdateOptions) GetPatternConfigVersion() string { + if s == nil || s.PatternConfigVersion == nil { + return "" + } + return *s.PatternConfigVersion +} + +// GetAlertTotal returns the AlertTotal field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetAlertTotal() int { + if s == nil || s.AlertTotal == nil { + return 0 + } + return *s.AlertTotal +} + +// GetAlertTotalPercentage returns the AlertTotalPercentage field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetAlertTotalPercentage() int { + if s == nil || s.AlertTotalPercentage == nil { + return 0 + } + return *s.AlertTotalPercentage +} + +// GetBypassrate returns the Bypassrate field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetBypassrate() int { + if s == nil || s.Bypassrate == nil { + return 0 + } + return *s.Bypassrate +} + +// GetCustomPatternVersion returns the CustomPatternVersion field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetCustomPatternVersion() string { + if s == nil || s.CustomPatternVersion == nil { + return "" + } + return *s.CustomPatternVersion +} + +// GetDefaultSetting returns the DefaultSetting field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetDefaultSetting() string { + if s == nil || s.DefaultSetting == nil { + return "" + } + return *s.DefaultSetting +} + +// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetDisplayName() string { + if s == nil || s.DisplayName == nil { + return "" + } + return *s.DisplayName +} + +// GetEnterpriseSetting returns the EnterpriseSetting field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetEnterpriseSetting() string { + if s == nil || s.EnterpriseSetting == nil { + return "" + } + return *s.EnterpriseSetting +} + +// GetFalsePositiveRate returns the FalsePositiveRate field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetFalsePositiveRate() int { + if s == nil || s.FalsePositiveRate == nil { + return 0 + } + return *s.FalsePositiveRate +} + +// GetFalsePositives returns the FalsePositives field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetFalsePositives() int { + if s == nil || s.FalsePositives == nil { + return 0 + } + return *s.FalsePositives +} + +// GetSetting returns the Setting field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetSetting() string { + if s == nil || s.Setting == nil { + return "" + } + return *s.Setting +} + +// GetSlug returns the Slug field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetSlug() string { + if s == nil || s.Slug == nil { + return "" + } + return *s.Slug +} + +// GetTokenType returns the TokenType field if it's non-nil, zero value otherwise. +func (s *SecretScanningPatternOverride) GetTokenType() string { + if s == nil || s.TokenType == nil { + return "" + } + return *s.TokenType +} + // GetStatus returns the Status field if it's non-nil, zero value otherwise. func (s *SecretScanningPushProtection) GetStatus() string { if s == nil || s.Status == nil { @@ -24790,6 +26254,38 @@ func (s *SelectedReposList) GetTotalCount() int { return *s.TotalCount } +// GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise. +func (s *SelfHostedRunnersSettingsOrganization) GetEnabledRepositories() string { + if s == nil || s.EnabledRepositories == nil { + return "" + } + return *s.EnabledRepositories +} + +// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise. +func (s *SelfHostedRunnersSettingsOrganization) GetSelectedRepositoriesURL() string { + if s == nil || s.SelectedRepositoriesURL == nil { + return "" + } + return *s.SelectedRepositoriesURL +} + +// GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise. +func (s *SelfHostedRunnersSettingsOrganizationOpt) GetEnabledRepositories() string { + if s == nil || s.EnabledRepositories == nil { + return "" + } + return *s.EnabledRepositories +} + +// GetDisableSelfHostedRunnersForAllOrgs returns the DisableSelfHostedRunnersForAllOrgs field if it's non-nil, zero value otherwise. +func (s *SelfHostRunnerPermissionsEnterprise) GetDisableSelfHostedRunnersForAllOrgs() bool { + if s == nil || s.DisableSelfHostedRunnersForAllOrgs == nil { + return false + } + return *s.DisableSelfHostedRunnersForAllOrgs +} + // GetFrom returns the From field if it's non-nil, zero value otherwise. func (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string { if s == nil || s.From == nil { @@ -24846,6 +26342,22 @@ func (s *SignatureVerification) GetVerified() bool { return *s.Verified } +// GetProvider returns the Provider field if it's non-nil, zero value otherwise. +func (s *SocialAccount) GetProvider() string { + if s == nil || s.Provider == nil { + return "" + } + return *s.Provider +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *SocialAccount) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + // GetActor returns the Actor field. func (s *Source) GetActor() *User { if s == nil { @@ -25278,6 +26790,30 @@ func (s *StatusEvent) GetUpdatedAt() Timestamp { return *s.UpdatedAt } +// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetAfterID() int64 { + if s == nil || s.AfterID == nil { + return 0 + } + return *s.AfterID +} + +// GetBeforeID returns the BeforeID field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetBeforeID() int64 { + if s == nil || s.BeforeID == nil { + return 0 + } + return *s.BeforeID +} + +// GetReplaceParent returns the ReplaceParent field if it's non-nil, zero value otherwise. +func (s *SubIssueRequest) GetReplaceParent() bool { + if s == nil || s.ReplaceParent == nil { + return false + } + return *s.ReplaceParent +} + // GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise. func (s *Subscription) GetCreatedAt() Timestamp { if s == nil || s.CreatedAt == nil { @@ -26774,6 +28310,14 @@ func (u *UpdateEnterpriseRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetForce returns the Force field if it's non-nil, zero value otherwise. +func (u *UpdateRef) GetForce() bool { + if u == nil || u.Force == nil { + return false + } + return *u.Force +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool { if u == nil || u.AllowsPublicRepositories == nil { @@ -26806,6 +28350,126 @@ func (u *UpdateRunnerGroupRequest) GetVisibility() string { return *u.Visibility } +// GetDate returns the Date field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetDate() string { + if u == nil || u.Date == nil { + return "" + } + return *u.Date +} + +// GetDiscountAmount returns the DiscountAmount field. +func (u *UsageItem) GetDiscountAmount() *float64 { + if u == nil { + return nil + } + return u.DiscountAmount +} + +// GetGrossAmount returns the GrossAmount field. +func (u *UsageItem) GetGrossAmount() *float64 { + if u == nil { + return nil + } + return u.GrossAmount +} + +// GetNetAmount returns the NetAmount field. +func (u *UsageItem) GetNetAmount() *float64 { + if u == nil { + return nil + } + return u.NetAmount +} + +// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetOrganizationName() string { + if u == nil || u.OrganizationName == nil { + return "" + } + return *u.OrganizationName +} + +// GetPricePerUnit returns the PricePerUnit field. +func (u *UsageItem) GetPricePerUnit() *float64 { + if u == nil { + return nil + } + return u.PricePerUnit +} + +// GetProduct returns the Product field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetProduct() string { + if u == nil || u.Product == nil { + return "" + } + return *u.Product +} + +// GetQuantity returns the Quantity field. +func (u *UsageItem) GetQuantity() *float64 { + if u == nil { + return nil + } + return u.Quantity +} + +// GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetRepositoryName() string { + if u == nil || u.RepositoryName == nil { + return "" + } + return *u.RepositoryName +} + +// GetSKU returns the SKU field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetSKU() string { + if u == nil || u.SKU == nil { + return "" + } + return *u.SKU +} + +// GetUnitType returns the UnitType field if it's non-nil, zero value otherwise. +func (u *UsageItem) GetUnitType() string { + if u == nil || u.UnitType == nil { + return "" + } + return *u.UnitType +} + +// GetDay returns the Day field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetDay() int { + if u == nil || u.Day == nil { + return 0 + } + return *u.Day +} + +// GetHour returns the Hour field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetHour() int { + if u == nil || u.Hour == nil { + return 0 + } + return *u.Hour +} + +// GetMonth returns the Month field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetMonth() int { + if u == nil || u.Month == nil { + return 0 + } + return *u.Month +} + +// GetYear returns the Year field if it's non-nil, zero value otherwise. +func (u *UsageReportOptions) GetYear() int { + if u == nil || u.Year == nil { + return 0 + } + return *u.Year +} + // GetAssignment returns the Assignment field if it's non-nil, zero value otherwise. func (u *User) GetAssignment() string { if u == nil || u.Assignment == nil { @@ -28502,6 +30166,62 @@ func (w *Workflows) GetTotalCount() int { return *w.TotalCount } +// GetRequireApprovalForForkPRWorkflows returns the RequireApprovalForForkPRWorkflows field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissions) GetRequireApprovalForForkPRWorkflows() bool { + if w == nil || w.RequireApprovalForForkPRWorkflows == nil { + return false + } + return *w.RequireApprovalForForkPRWorkflows +} + +// GetRunWorkflowsFromForkPullRequests returns the RunWorkflowsFromForkPullRequests field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissions) GetRunWorkflowsFromForkPullRequests() bool { + if w == nil || w.RunWorkflowsFromForkPullRequests == nil { + return false + } + return *w.RunWorkflowsFromForkPullRequests +} + +// GetSendSecretsAndVariables returns the SendSecretsAndVariables field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissions) GetSendSecretsAndVariables() bool { + if w == nil || w.SendSecretsAndVariables == nil { + return false + } + return *w.SendSecretsAndVariables +} + +// GetSendWriteTokensToWorkflows returns the SendWriteTokensToWorkflows field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissions) GetSendWriteTokensToWorkflows() bool { + if w == nil || w.SendWriteTokensToWorkflows == nil { + return false + } + return *w.SendWriteTokensToWorkflows +} + +// GetRequireApprovalForForkPRWorkflows returns the RequireApprovalForForkPRWorkflows field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissionsOpt) GetRequireApprovalForForkPRWorkflows() bool { + if w == nil || w.RequireApprovalForForkPRWorkflows == nil { + return false + } + return *w.RequireApprovalForForkPRWorkflows +} + +// GetSendSecretsAndVariables returns the SendSecretsAndVariables field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissionsOpt) GetSendSecretsAndVariables() bool { + if w == nil || w.SendSecretsAndVariables == nil { + return false + } + return *w.SendSecretsAndVariables +} + +// GetSendWriteTokensToWorkflows returns the SendWriteTokensToWorkflows field if it's non-nil, zero value otherwise. +func (w *WorkflowsPermissionsOpt) GetSendWriteTokensToWorkflows() bool { + if w == nil || w.SendWriteTokensToWorkflows == nil { + return false + } + return *w.SendWriteTokensToWorkflows +} + // GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise. func (w *WorkflowsRuleParameters) GetDoNotEnforceOnCreate() bool { if w == nil || w.DoNotEnforceOnCreate == nil { diff --git a/vendor/github.com/google/go-github/v69/github/github.go b/vendor/github.com/google/go-github/v75/github/github.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/github.go rename to vendor/github.com/google/go-github/v75/github/github.go index d163b32d2..ac2a961d6 100644 --- a/vendor/github.com/google/go-github/v69/github/github.go +++ b/vendor/github.com/google/go-github/v75/github/github.go @@ -29,7 +29,7 @@ import ( ) const ( - Version = "v69.2.0" + Version = "v75.0.0" defaultAPIVersion = "2022-11-28" defaultBaseURL = "https://api.github.com/" @@ -54,6 +54,7 @@ const ( mediaTypeV3Patch = "application/vnd.github.v3.patch" mediaTypeOrgPermissionRepo = "application/vnd.github.v3.repository+json" mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" + mediaTypeStarring = "application/vnd.github.star+json" // Media Type values to access preview APIs // These media types will be added to the API request as headers @@ -72,9 +73,6 @@ const ( // // See https://github.com/google/go-github/pull/2125 for full context. - // https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/ - mediaTypeStarringPreview = "application/vnd.github.v3.star+json" - // https://help.github.com/enterprise/2.4/admin/guides/migrations/exporting-the-github-com-organization-s-repositories/ mediaTypeMigrationsPreview = "application/vnd.github.wyandotte-preview+json" @@ -173,6 +171,11 @@ type Client struct { // User agent used when communicating with the GitHub API. UserAgent string + // DisableRateLimitCheck stops the client checking for rate limits or tracking + // them. This is different to setting BypassRateLimitCheck in the context, + // as that still tracks the rate limits. + DisableRateLimitCheck bool + rateMu sync.Mutex 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. @@ -194,6 +197,7 @@ type Client struct { Authorizations *AuthorizationsService Billing *BillingService Checks *ChecksService + Classroom *ClassroomService CodeScanning *CodeScanningService CodesOfConduct *CodesOfConductService Codespaces *CodespacesService @@ -222,6 +226,7 @@ type Client struct { Search *SearchService SecretScanning *SecretScanningService SecurityAdvisories *SecurityAdvisoriesService + SubIssue *SubIssueService Teams *TeamsService Users *UsersService } @@ -302,7 +307,7 @@ type RawOptions struct { // addOptions adds the parameters in opts as URL query parameters to s. opts // must be a struct whose fields may contain "url" tags. -func addOptions(s string, opts interface{}) (string, error) { +func addOptions(s string, opts any) (string, error) { v := reflect.ValueOf(opts) if v.Kind() == reflect.Ptr && v.IsNil() { return s, nil @@ -410,7 +415,7 @@ func (c *Client) initialize() { c.clientIgnoreRedirects.Transport = c.client.Transport c.clientIgnoreRedirects.Timeout = c.client.Timeout c.clientIgnoreRedirects.Jar = c.client.Jar - c.clientIgnoreRedirects.CheckRedirect = func(req *http.Request, via []*http.Request) error { + c.clientIgnoreRedirects.CheckRedirect = func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } if c.BaseURL == nil { @@ -430,6 +435,7 @@ func (c *Client) initialize() { c.Authorizations = (*AuthorizationsService)(&c.common) c.Billing = (*BillingService)(&c.common) c.Checks = (*ChecksService)(&c.common) + c.Classroom = (*ClassroomService)(&c.common) c.CodeScanning = (*CodeScanningService)(&c.common) c.Codespaces = (*CodespacesService)(&c.common) c.CodesOfConduct = (*CodesOfConductService)(&c.common) @@ -458,6 +464,7 @@ func (c *Client) initialize() { c.Search = (*SearchService)(&c.common) c.SecretScanning = (*SecretScanningService)(&c.common) c.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common) + c.SubIssue = (*SubIssueService)(&c.common) c.Teams = (*TeamsService)(&c.common) c.Users = (*UsersService)(&c.common) } @@ -524,7 +531,7 @@ func WithVersion(version string) RequestOption { // Relative URLs should always be specified without a preceding slash. If // specified, the value pointed to by body is JSON encoded and included as the // request body. -func (c *Client) NewRequest(method, urlStr string, body interface{}, opts ...RequestOption) (*http.Request, error) { +func (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error) { if !strings.HasSuffix(c.BaseURL.Path, "/") { return nil, fmt.Errorf("baseURL must have a trailing slash, but %q does not", c.BaseURL) } @@ -850,21 +857,26 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ req = withContext(ctx, req) - rateLimitCategory := GetRateLimitCategory(req.Method, req.URL.Path) + rateLimitCategory := CoreCategory - if bypass := ctx.Value(BypassRateLimitCheck); bypass == nil { - // If we've hit rate limit, don't make further requests before Reset time. - if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { - return &Response{ - Response: err.Response, - Rate: err.Rate, - }, err - } - // If we've hit a secondary rate limit, don't make further requests before Retry After. - if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { - return &Response{ - Response: err.Response, - }, err + if !c.DisableRateLimitCheck { + 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. + if err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil { + return &Response{ + Response: err.Response, + Rate: err.Rate, + }, err + } + + // If we've hit a secondary rate limit, don't make further requests before Retry After. + if err := c.checkSecondaryRateLimitBeforeDo(req); err != nil { + return &Response{ + Response: err.Response, + }, err + } } } @@ -894,9 +906,10 @@ func (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Requ return response, err } - // Don't update the rate limits if this was a cached response. - // X-From-Cache is set by https://github.com/gregjones/httpcache - if response.Header.Get("X-From-Cache") == "" { + // Don't update the rate limits if the client has rate limits disabled or if + // this was a cached response. The X-From-Cache is set by + // https://github.com/bartventer/httpcache if it's enabled. + if !c.DisableRateLimitCheck && response.Header.Get("X-From-Cache") == "" { c.rateMu.Lock() c.rateLimits[rateLimitCategory] = response.Rate c.rateMu.Unlock() @@ -1021,7 +1034,7 @@ func (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRed // // The provided ctx must be non-nil, if it is nil an error is returned. If it // is canceled or times out, ctx.Err() will be returned. -func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) { +func (c *Client) Do(ctx context.Context, req *http.Request, v any) (*Response, error) { resp, err := c.BareDo(ctx, req) if err != nil { return resp, err @@ -1379,6 +1392,7 @@ func (e *Error) Error() string { e.Code, e.Field, e.Resource) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (e *Error) UnmarshalJSON(data []byte) error { type aliasError Error // avoid infinite recursion by using type alias. if err := json.Unmarshal(data, (*aliasError)(e)); err != nil { @@ -1391,12 +1405,12 @@ func (e *Error) UnmarshalJSON(data []byte) error { // present. A response is considered an error if it has a status code outside // the 200 range or equal to 202 Accepted. // API error responses are expected to have response -// body, and a JSON response body that maps to ErrorResponse. +// body, and a JSON response body that maps to [ErrorResponse]. // -// The error type will be *RateLimitError for rate limit exceeded errors, -// *AcceptedError for 202 Accepted status codes, -// *TwoFactorAuthError for two-factor authentication errors, -// and *RedirectionError for redirect status codes (only happens when ignoring redirections). +// The error type will be *[RateLimitError] for rate limit exceeded errors, +// *[AcceptedError] for 202 Accepted status codes, +// *[TwoFactorAuthError] for two-factor authentication errors, +// and *[RedirectionError] for redirect status codes (only happens when ignoring redirections). func CheckResponse(r *http.Response) error { if r.StatusCode == http.StatusAccepted { return &AcceptedError{} @@ -1481,6 +1495,7 @@ func parseBoolResponse(err error) (bool, error) { return false, err } +// RateLimitCategory represents the enumeration of rate limit categories. type RateLimitCategory uint8 const ( @@ -1586,8 +1601,8 @@ that need to use a higher rate limit associated with your OAuth application. This will add the client id and secret as a base64-encoded string in the format ClientID:ClientSecret and apply it as an "Authorization": "Basic" header. -See https://docs.github.com/rest/#unauthenticated-rate-limited-requests for -more information. +See https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps +for more information. */ type UnauthenticatedRateLimitedTransport struct { // ClientID is the GitHub OAuth client ID of the current application, which @@ -1772,7 +1787,7 @@ func (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) { return fn(r) } -var runIDFromURLRE = regexp.MustCompile(`^repos/.*/actions/runs/(\d+)/deployment_protection_rule$`) +var runIDFromURLRE = regexp.MustCompile(`repos/.*/actions/runs/(\d+)/deployment_protection_rule$`) // GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL. func (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) { diff --git a/vendor/github.com/google/go-github/v69/github/gitignore.go b/vendor/github.com/google/go-github/v75/github/gitignore.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/gitignore.go rename to vendor/github.com/google/go-github/v75/github/gitignore.go diff --git a/vendor/github.com/google/go-github/v69/github/interactions.go b/vendor/github.com/google/go-github/v75/github/interactions.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/interactions.go rename to vendor/github.com/google/go-github/v75/github/interactions.go diff --git a/vendor/github.com/google/go-github/v69/github/interactions_orgs.go b/vendor/github.com/google/go-github/v75/github/interactions_orgs.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/interactions_orgs.go rename to vendor/github.com/google/go-github/v75/github/interactions_orgs.go diff --git a/vendor/github.com/google/go-github/v69/github/interactions_repos.go b/vendor/github.com/google/go-github/v75/github/interactions_repos.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/interactions_repos.go rename to vendor/github.com/google/go-github/v75/github/interactions_repos.go diff --git a/vendor/github.com/google/go-github/v69/github/issue_import.go b/vendor/github.com/google/go-github/v75/github/issue_import.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/issue_import.go rename to vendor/github.com/google/go-github/v75/github/issue_import.go diff --git a/vendor/github.com/google/go-github/v69/github/issues.go b/vendor/github.com/google/go-github/v75/github/issues.go similarity index 87% rename from vendor/github.com/google/go-github/v69/github/issues.go rename to vendor/github.com/google/go-github/v75/github/issues.go index 6d3a6b15c..18bd2eff4 100644 --- a/vendor/github.com/google/go-github/v69/github/issues.go +++ b/vendor/github.com/google/go-github/v75/github/issues.go @@ -29,10 +29,16 @@ type Issue struct { Number *int `json:"number,omitempty"` State *string `json:"state,omitempty"` // StateReason can be one of: "completed", "not_planned", "reopened". - StateReason *string `json:"state_reason,omitempty"` - Locked *bool `json:"locked,omitempty"` - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` + StateReason *string `json:"state_reason,omitempty"` + Locked *bool `json:"locked,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + // AuthorAssociation is the issue author's relationship to the repository. + // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Issues REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/issues/issues#get-an-issue AuthorAssociation *string `json:"author_association,omitempty"` User *User `json:"user,omitempty"` Labels []*Label `json:"labels,omitempty"` @@ -90,6 +96,7 @@ type IssueRequest struct { StateReason *string `json:"state_reason,omitempty"` Milestone *int `json:"milestone,omitempty"` Assignees *[]string `json:"assignees,omitempty"` + Type *string `json:"type,omitempty"` } // IssueListOptions specifies the optional parameters to the IssuesService.List @@ -117,6 +124,10 @@ type IssueListOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } @@ -131,7 +142,7 @@ type PullRequestLinks struct { } // IssueType represents the type of issue. -// For now it shows up when receiveing an Issue event. +// For now it shows up when receiving an Issue event. type IssueType struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -233,6 +244,10 @@ type IssueListByRepoOptions struct { // Since filters issues by time. Since time.Time `url:"since,omitempty"` + ListCursorOptions + + // Add ListOptions so offset pagination with integer type "page" query parameter is accepted + // since ListCursorOptions accepts "page" as string only. ListOptions } @@ -241,7 +256,7 @@ type IssueListByRepoOptions struct { // GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues // //meta:operation GET /repos/{owner}/{repo}/issues -func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { +func (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -270,7 +285,7 @@ func (s *IssuesService) ListByRepo(ctx context.Context, owner string, repo strin // GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number} -func (s *IssuesService) Get(ctx context.Context, owner string, repo string, number int) (*Issue, *Response, error) { +func (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -294,7 +309,7 @@ func (s *IssuesService) Get(ctx context.Context, owner string, repo string, numb // GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues -func (s *IssuesService) Create(ctx context.Context, owner string, repo string, issue *IssueRequest) (*Issue, *Response, error) { +func (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues", owner, repo) req, err := s.client.NewRequest("POST", u, issue) if err != nil { @@ -315,7 +330,7 @@ func (s *IssuesService) Create(ctx context.Context, owner string, repo string, i // GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue // //meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number} -func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { +func (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, issue) if err != nil { @@ -370,7 +385,7 @@ type LockIssueOptions struct { // GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue // //meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/lock -func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, number int, opts *LockIssueOptions) (*Response, error) { +func (s *IssuesService) Lock(ctx context.Context, owner, repo string, number int, opts *LockIssueOptions) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("PUT", u, opts) if err != nil { @@ -385,7 +400,7 @@ func (s *IssuesService) Lock(ctx context.Context, owner string, repo string, num // GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock -func (s *IssuesService) Unlock(ctx context.Context, owner string, repo string, number int) (*Response, error) { +func (s *IssuesService) Unlock(ctx context.Context, owner, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/lock", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/issues_assignees.go b/vendor/github.com/google/go-github/v75/github/issues_assignees.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/issues_assignees.go rename to vendor/github.com/google/go-github/v75/github/issues_assignees.go diff --git a/vendor/github.com/google/go-github/v69/github/issues_comments.go b/vendor/github.com/google/go-github/v75/github/issues_comments.go similarity index 86% rename from vendor/github.com/google/go-github/v69/github/issues_comments.go rename to vendor/github.com/google/go-github/v75/github/issues_comments.go index 74a4e60f7..7e0629eb3 100644 --- a/vendor/github.com/google/go-github/v69/github/issues_comments.go +++ b/vendor/github.com/google/go-github/v75/github/issues_comments.go @@ -22,6 +22,10 @@ type IssueComment struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` // AuthorAssociation is the comment author's relationship to the issue's repository. // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Issue Comments REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/issues/comments#get-an-issue-comment AuthorAssociation *string `json:"author_association,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` @@ -55,7 +59,7 @@ type IssueListCommentsOptions struct { // //meta:operation GET /repos/{owner}/{repo}/issues/comments //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/comments -func (s *IssuesService) ListComments(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { +func (s *IssuesService) ListComments(ctx context.Context, owner, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) { var u string if number == 0 { u = fmt.Sprintf("repos/%v/%v/issues/comments", owner, repo) @@ -89,7 +93,7 @@ func (s *IssuesService) ListComments(ctx context.Context, owner string, repo str // GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id} -func (s *IssuesService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*IssueComment, *Response, error) { +func (s *IssuesService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("GET", u, nil) @@ -114,7 +118,7 @@ func (s *IssuesService) GetComment(ctx context.Context, owner string, repo strin // GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/comments -func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { +func (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/comments", owner, repo, number) req, err := s.client.NewRequest("POST", u, comment) if err != nil { @@ -135,7 +139,7 @@ func (s *IssuesService) CreateComment(ctx context.Context, owner string, repo st // GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment // //meta:operation PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} -func (s *IssuesService) EditComment(ctx context.Context, owner string, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { +func (s *IssuesService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("PATCH", u, comment) if err != nil { @@ -155,7 +159,7 @@ func (s *IssuesService) EditComment(ctx context.Context, owner string, repo stri // GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment // //meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id} -func (s *IssuesService) DeleteComment(ctx context.Context, owner string, repo string, commentID int64) (*Response, error) { +func (s *IssuesService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%d", owner, repo, commentID) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/issues_events.go b/vendor/github.com/google/go-github/v75/github/issues_events.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/issues_events.go rename to vendor/github.com/google/go-github/v75/github/issues_events.go diff --git a/vendor/github.com/google/go-github/v69/github/issues_labels.go b/vendor/github.com/google/go-github/v75/github/issues_labels.go similarity index 85% rename from vendor/github.com/google/go-github/v69/github/issues_labels.go rename to vendor/github.com/google/go-github/v75/github/issues_labels.go index b97b00f3e..e2099034c 100644 --- a/vendor/github.com/google/go-github/v69/github/issues_labels.go +++ b/vendor/github.com/google/go-github/v75/github/issues_labels.go @@ -30,7 +30,7 @@ func (l Label) String() string { // GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/labels -func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Label, *Response, error) { +func (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -56,7 +56,7 @@ func (s *IssuesService) ListLabels(ctx context.Context, owner string, repo strin // GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label // //meta:operation GET /repos/{owner}/{repo}/labels/{name} -func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, name string) (*Label, *Response, error) { +func (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -77,7 +77,7 @@ func (s *IssuesService) GetLabel(ctx context.Context, owner string, repo string, // GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label // //meta:operation POST /repos/{owner}/{repo}/labels -func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo string, label *Label) (*Label, *Response, error) { +func (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels", owner, repo) req, err := s.client.NewRequest("POST", u, label) if err != nil { @@ -98,7 +98,7 @@ func (s *IssuesService) CreateLabel(ctx context.Context, owner string, repo stri // GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label // //meta:operation PATCH /repos/{owner}/{repo}/labels/{name} -func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string, name string, label *Label) (*Label, *Response, error) { +func (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, label *Label) (*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("PATCH", u, label) if err != nil { @@ -119,7 +119,7 @@ func (s *IssuesService) EditLabel(ctx context.Context, owner string, repo string // GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label // //meta:operation DELETE /repos/{owner}/{repo}/labels/{name} -func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo string, name string) (*Response, error) { +func (s *IssuesService) DeleteLabel(ctx context.Context, owner, repo, name string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/labels/%v", owner, repo, name) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { @@ -133,7 +133,7 @@ func (s *IssuesService) DeleteLabel(ctx context.Context, owner string, repo stri // GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/labels -func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { +func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opts) if err != nil { @@ -159,7 +159,7 @@ func (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner string, rep // GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue // //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/labels -func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { +func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) if err != nil { @@ -180,7 +180,7 @@ func (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner string, repo // GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name} -func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, repo string, number int, label string) (*Response, error) { +func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner, repo string, number int, label string) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels/%v", owner, repo, number, label) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { @@ -195,7 +195,7 @@ func (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner string, r // GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue // //meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/labels -func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { +func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("PUT", u, labels) if err != nil { @@ -216,7 +216,7 @@ func (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner string, // GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue // //meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels -func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, repo string, number int) (*Response, error) { +func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { @@ -231,7 +231,7 @@ func (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner string, // GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone // //meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels -func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { +func (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d/labels", owner, repo, number) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/issues_milestones.go b/vendor/github.com/google/go-github/v75/github/issues_milestones.go similarity index 91% rename from vendor/github.com/google/go-github/v69/github/issues_milestones.go rename to vendor/github.com/google/go-github/v75/github/issues_milestones.go index 6c31bcd05..2aab88945 100644 --- a/vendor/github.com/google/go-github/v69/github/issues_milestones.go +++ b/vendor/github.com/google/go-github/v75/github/issues_milestones.go @@ -57,7 +57,7 @@ type MilestoneListOptions struct { // GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones // //meta:operation GET /repos/{owner}/{repo}/milestones -func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { +func (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -83,7 +83,7 @@ func (s *IssuesService) ListMilestones(ctx context.Context, owner string, repo s // GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone // //meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number} -func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo string, number int) (*Milestone, *Response, error) { +func (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, number int) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -104,7 +104,7 @@ func (s *IssuesService) GetMilestone(ctx context.Context, owner string, repo str // GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone // //meta:operation POST /repos/{owner}/{repo}/milestones -func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo string, milestone *Milestone) (*Milestone, *Response, error) { +func (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones", owner, repo) req, err := s.client.NewRequest("POST", u, milestone) if err != nil { @@ -125,7 +125,7 @@ func (s *IssuesService) CreateMilestone(ctx context.Context, owner string, repo // GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone // //meta:operation PATCH /repos/{owner}/{repo}/milestones/{milestone_number} -func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { +func (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("PATCH", u, milestone) if err != nil { @@ -146,7 +146,7 @@ func (s *IssuesService) EditMilestone(ctx context.Context, owner string, repo st // GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone // //meta:operation DELETE /repos/{owner}/{repo}/milestones/{milestone_number} -func (s *IssuesService) DeleteMilestone(ctx context.Context, owner string, repo string, number int) (*Response, error) { +func (s *IssuesService) DeleteMilestone(ctx context.Context, owner, repo string, number int) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/milestones/%d", owner, repo, number) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/issues_timeline.go b/vendor/github.com/google/go-github/v75/github/issues_timeline.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/issues_timeline.go rename to vendor/github.com/google/go-github/v75/github/issues_timeline.go diff --git a/vendor/github.com/google/go-github/v69/github/licenses.go b/vendor/github.com/google/go-github/v75/github/licenses.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/licenses.go rename to vendor/github.com/google/go-github/v75/github/licenses.go diff --git a/vendor/github.com/google/go-github/v69/github/markdown.go b/vendor/github.com/google/go-github/v75/github/markdown.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/markdown.go rename to vendor/github.com/google/go-github/v75/github/markdown.go diff --git a/vendor/github.com/google/go-github/v69/github/messages.go b/vendor/github.com/google/go-github/v75/github/messages.go similarity index 92% rename from vendor/github.com/google/go-github/v69/github/messages.go rename to vendor/github.com/google/go-github/v75/github/messages.go index 59b214b35..21eb7c70c 100644 --- a/vendor/github.com/google/go-github/v69/github/messages.go +++ b/vendor/github.com/google/go-github/v75/github/messages.go @@ -45,7 +45,7 @@ const ( var ( // eventTypeMapping maps webhooks types to their corresponding go-github struct types. - eventTypeMapping = map[string]interface{}{ + eventTypeMapping = map[string]any{ "branch_protection_configuration": &BranchProtectionConfigurationEvent{}, "branch_protection_rule": &BranchProtectionRuleEvent{}, "check_run": &CheckRunEvent{}, @@ -95,6 +95,7 @@ var ( "pull_request_review_thread": &PullRequestReviewThreadEvent{}, "pull_request_target": &PullRequestTargetEvent{}, "push": &PushEvent{}, + "registry_package": &RegistryPackageEvent{}, "repository": &RepositoryEvent{}, "repository_dispatch": &RepositoryDispatchEvent{}, "repository_import": &RepositoryImportEvent{}, @@ -185,11 +186,11 @@ func messageMAC(signature string) ([]byte, func() hash.Hash, error) { // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// // read signature from request -// signature := "" -// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... +// // read signature from request +// signature := "" +// payload, err := github.ValidatePayloadFromBody(r.Header.Get("Content-Type"), r.Body, signature, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... // } func ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error) { var body []byte // Raw body that GitHub uses to calculate the signature. @@ -248,9 +249,9 @@ func ValidatePayloadFromBody(contentType string, readable io.Reader, signature s // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// // Process payload... +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// // Process payload... // } func ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) { signature := r.Header.Get(SHA256SignatureHeader) @@ -299,25 +300,25 @@ func DeliveryID(r *http.Request) string { // ParseWebHook parses the event payload. For recognized event types, a // value of the corresponding struct type will be returned (as returned -// by Event.ParsePayload()). An error will be returned for unrecognized event +// by [Event.ParsePayload]). An error will be returned for unrecognized event // types. // // Example usage: // // func (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) { -// payload, err := github.ValidatePayload(r, s.webhookSecretKey) -// if err != nil { ... } -// event, err := github.ParseWebHook(github.WebHookType(r), payload) -// if err != nil { ... } -// switch event := event.(type) { -// case *github.CommitCommentEvent: -// processCommitCommentEvent(event) -// case *github.CreateEvent: -// processCreateEvent(event) -// ... -// } +// payload, err := github.ValidatePayload(r, s.webhookSecretKey) +// if err != nil { ... } +// event, err := github.ParseWebHook(github.WebHookType(r), payload) +// if err != nil { ... } +// switch event := event.(type) { +// case *github.CommitCommentEvent: +// processCommitCommentEvent(event) +// case *github.CreateEvent: +// processCreateEvent(event) +// ... +// } // } -func ParseWebHook(messageType string, payload []byte) (interface{}, error) { +func ParseWebHook(messageType string, payload []byte) (any, error) { eventType, ok := messageToTypeName[messageType] if !ok { return nil, fmt.Errorf("unknown X-Github-Event in message: %v", messageType) @@ -343,7 +344,7 @@ func MessageTypes() []string { // EventForType returns an empty struct matching the specified GitHub event type. // If messageType does not match any known event types, it returns nil. -func EventForType(messageType string) interface{} { +func EventForType(messageType string) any { prototype := eventTypeMapping[messageType] if prototype == nil { return nil diff --git a/vendor/github.com/google/go-github/v69/github/meta.go b/vendor/github.com/google/go-github/v75/github/meta.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/meta.go rename to vendor/github.com/google/go-github/v75/github/meta.go index cc90b618b..0637dfe0d 100644 --- a/vendor/github.com/google/go-github/v69/github/meta.go +++ b/vendor/github.com/google/go-github/v75/github/meta.go @@ -52,6 +52,10 @@ type APIMeta struct { // GitHub Actions will originate from. Actions []string `json:"actions,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses + // GitHub Action macOS runner will originate from. + ActionsMacos []string `json:"actions_macos,omitempty"` + // An array of IP addresses in CIDR format specifying the IP addresses // Dependabot will originate from. Dependabot []string `json:"dependabot,omitempty"` @@ -156,7 +160,7 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response // Zen returns a random line from The Zen of GitHub. // -// See also: http://warpspire.com/posts/taste/ +// See also: https://warpspire.com/posts/taste/ // // GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github // diff --git a/vendor/github.com/google/go-github/v69/github/migrations.go b/vendor/github.com/google/go-github/v75/github/migrations.go similarity index 89% rename from vendor/github.com/google/go-github/v69/github/migrations.go rename to vendor/github.com/google/go-github/v75/github/migrations.go index 766c4c38e..b33be5edd 100644 --- a/vendor/github.com/google/go-github/v69/github/migrations.go +++ b/vendor/github.com/google/go-github/v75/github/migrations.go @@ -55,6 +55,14 @@ type MigrationOptions struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments bool + + // ExcludeReleases indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases bool + + // Exclude is a slice of related items to exclude from the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string } // startMigration represents the body of a StartMigration request. @@ -69,6 +77,14 @@ type startMigration struct { // ExcludeAttachments indicates whether attachments should be excluded from // the migration (to reduce migration archive file size). ExcludeAttachments *bool `json:"exclude_attachments,omitempty"` + + // ExcludeReleases indicates whether releases should be excluded from + // the migration (to reduce migration archive file size). + ExcludeReleases *bool `json:"exclude_releases,omitempty"` + + // Exclude is a slice of related items to exclude from the response in order + // to improve performance of the request. Supported values are: "repositories" + Exclude []string `json:"exclude,omitempty"` } // StartMigration starts the generation of a migration archive. @@ -84,6 +100,8 @@ func (s *MigrationService) StartMigration(ctx context.Context, org string, repos if opts != nil { body.LockRepositories = Ptr(opts.LockRepositories) body.ExcludeAttachments = Ptr(opts.ExcludeAttachments) + body.ExcludeReleases = Ptr(opts.ExcludeReleases) + body.Exclude = append(body.Exclude, opts.Exclude...) } req, err := s.client.NewRequest("POST", u, body) @@ -181,7 +199,7 @@ func (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, // Disable the redirect mechanism because AWS fails if the GitHub auth token is provided. var loc string saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return errors.New("disable redirect") } diff --git a/vendor/github.com/google/go-github/v69/github/migrations_source_import.go b/vendor/github.com/google/go-github/v75/github/migrations_source_import.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/migrations_source_import.go rename to vendor/github.com/google/go-github/v75/github/migrations_source_import.go diff --git a/vendor/github.com/google/go-github/v69/github/migrations_user.go b/vendor/github.com/google/go-github/v75/github/migrations_user.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/migrations_user.go rename to vendor/github.com/google/go-github/v75/github/migrations_user.go index a7bd79499..58e780ea7 100644 --- a/vendor/github.com/google/go-github/v69/github/migrations_user.go +++ b/vendor/github.com/google/go-github/v75/github/migrations_user.go @@ -172,7 +172,7 @@ func (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64 var loc string originalRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return http.ErrUseLastResponse } diff --git a/vendor/github.com/google/go-github/v69/github/orgs.go b/vendor/github.com/google/go-github/v75/github/orgs.go similarity index 88% rename from vendor/github.com/google/go-github/v69/github/orgs.go rename to vendor/github.com/google/go-github/v75/github/orgs.go index 27c0f1028..bec49bbff 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs.go +++ b/vendor/github.com/google/go-github/v75/github/orgs.go @@ -97,6 +97,24 @@ type Organization struct { SecretScanningPushProtectionEnabledForNewRepos *bool `json:"secret_scanning_push_protection_enabled_for_new_repositories,omitempty"` // SecretScanningValidityChecksEnabled toggles whether secret scanning validity check is enabled. SecretScanningValidityChecksEnabled *bool `json:"secret_scanning_validity_checks_enabled,omitempty"` + // MembersCanDeleteRepositories toggles whether members with admin permissions can delete a repository. + MembersCanDeleteRepositories *bool `json:"members_can_delete_repositories,omitempty"` + // MembersCanChangeRepoVisibility toggles whether members with admin permissions can change the visibility for a repository. + MembersCanChangeRepoVisibility *bool `json:"members_can_change_repo_visiblilty,omitempty"` + // MembersCanInviteOutsideCollaborators toggles whether members with admin permissions can invite outside collaborators. + MembersCanInviteOutsideCollaborators *bool `json:"members_can_invite_outside_collaborators,omitempty"` + // MembersCanDeleteIssues toggles whether members with admin permissions can delete issues. + MembersCanDeleteIssues *bool `json:"members_can_delete_issues,omitempty"` + // DisplayCommenterFullNameSettingEnabled toggles whether members can see the comment author's profile name in private repositories. + DisplayCommenterFullNameSettingEnabled *bool `json:"display_commenter_full_name_setting_enabled,omitempty"` + // ReadersCanCreateDiscussions toggles whether users with read access can create and comment on discussions. + ReadersCanCreateDiscussions *bool `json:"readers_can_create_discussions,omitempty"` + // MembersCanCreateTeams toggles whether members of an organization can create new teams. + MembersCanCreateTeams *bool `json:"members_can_create_teams,omitempty"` + // MembersCanViewDependencyInsights toggles whether members may view dependency insights. + MembersCanViewDependencyInsights *bool `json:"members_can_view_dependency_insights,omitempty"` + // DefaultRepositoryBranch is the default branch for new repositories in the organization. + DefaultRepositoryBranch *string `json:"default_repository_branch,omitempty"` // API URLs URL *string `json:"url,omitempty"` diff --git a/vendor/github.com/google/go-github/v69/github/orgs_actions_allowed.go b/vendor/github.com/google/go-github/v75/github/orgs_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_actions_allowed.go rename to vendor/github.com/google/go-github/v75/github/orgs_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_actions_permissions.go b/vendor/github.com/google/go-github/v75/github/orgs_actions_permissions.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_actions_permissions.go rename to vendor/github.com/google/go-github/v75/github/orgs_actions_permissions.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_attestations.go b/vendor/github.com/google/go-github/v75/github/orgs_attestations.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/orgs_attestations.go rename to vendor/github.com/google/go-github/v75/github/orgs_attestations.go index 3d5793c18..d0ac123e2 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_attestations.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_attestations.go @@ -18,7 +18,7 @@ import ( // //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 := fmt.Sprintf("orgs/%v/attestations/%v", org, subjectDigest) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/orgs_audit_log.go b/vendor/github.com/google/go-github/v75/github/orgs_audit_log.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/orgs_audit_log.go rename to vendor/github.com/google/go-github/v75/github/orgs_audit_log.go index 025c5d023..8aae4ef38 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_audit_log.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_audit_log.go @@ -43,19 +43,20 @@ type AuditEntry struct { HashedToken *string `json:"hashed_token,omitempty"` Org *string `json:"org,omitempty"` OrgID *int64 `json:"org_id,omitempty"` - Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time). TokenID *int64 `json:"token_id,omitempty"` TokenScopes *string `json:"token_scopes,omitempty"` User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available). UserID *int64 `json:"user_id,omitempty"` // Some events types have a data field that contains additional information about the event. - Data map[string]interface{} `json:"data,omitempty"` + Data map[string]any `json:"data,omitempty"` // All fields that are not explicitly defined in the struct are captured here. - AdditionalFields map[string]interface{} `json:"-"` + AdditionalFields map[string]any `json:"-"` } +// UnmarshalJSON implements the json.Unmarshaler interface. func (a *AuditEntry) UnmarshalJSON(data []byte) error { type entryAlias AuditEntry var v entryAlias @@ -67,7 +68,7 @@ func (a *AuditEntry) UnmarshalJSON(data []byte) error { if err != nil { return err } - definedFields := map[string]interface{}{} + definedFields := map[string]any{} if err := json.Unmarshal(rawDefinedFields, &definedFields); err != nil { return err } @@ -89,6 +90,7 @@ func (a *AuditEntry) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaler interface. func (a *AuditEntry) MarshalJSON() ([]byte, error) { type entryAlias AuditEntry v := entryAlias(*a) @@ -99,7 +101,7 @@ func (a *AuditEntry) MarshalJSON() ([]byte, error) { if len(a.AdditionalFields) == 0 { return defBytes, err } - resMap := map[string]interface{}{} + resMap := map[string]any{} if err := json.Unmarshal(defBytes, &resMap); err != nil { return nil, err } diff --git a/vendor/github.com/google/go-github/v69/github/orgs_codesecurity_configurations.go b/vendor/github.com/google/go-github/v75/github/orgs_codesecurity_configurations.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_codesecurity_configurations.go rename to vendor/github.com/google/go-github/v75/github/orgs_codesecurity_configurations.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_credential_authorizations.go b/vendor/github.com/google/go-github/v75/github/orgs_credential_authorizations.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_credential_authorizations.go rename to vendor/github.com/google/go-github/v75/github/orgs_credential_authorizations.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_custom_repository_roles.go b/vendor/github.com/google/go-github/v75/github/orgs_custom_repository_roles.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_custom_repository_roles.go rename to vendor/github.com/google/go-github/v75/github/orgs_custom_repository_roles.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_hooks.go b/vendor/github.com/google/go-github/v75/github/orgs_hooks.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/orgs_hooks.go rename to vendor/github.com/google/go-github/v75/github/orgs_hooks.go index c2eef77c9..9ad380cb9 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_hooks.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_hooks.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" ) @@ -67,6 +68,10 @@ func (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64 // //meta:operation POST /orgs/{org}/hooks func (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) { + if hook == nil { + return nil, nil, errors.New("hook must be provided") + } + u := fmt.Sprintf("orgs/%v/hooks", org) hookReq := &createHookRequest{ diff --git a/vendor/github.com/google/go-github/v69/github/orgs_hooks_configuration.go b/vendor/github.com/google/go-github/v75/github/orgs_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_hooks_configuration.go rename to vendor/github.com/google/go-github/v75/github/orgs_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_hooks_deliveries.go b/vendor/github.com/google/go-github/v75/github/orgs_hooks_deliveries.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_hooks_deliveries.go rename to vendor/github.com/google/go-github/v75/github/orgs_hooks_deliveries.go diff --git a/vendor/github.com/google/go-github/v75/github/orgs_issue_types.go b/vendor/github.com/google/go-github/v75/github/orgs_issue_types.go new file mode 100644 index 000000000..73e6f8d63 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/orgs_issue_types.go @@ -0,0 +1,99 @@ +// Copyright 2025 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" +) + +// CreateOrUpdateIssueTypesOptions represents the parameters for creating or updating an issue type. +type CreateOrUpdateIssueTypesOptions struct { + Name string `json:"name"` // Name of the issue type. (Required.) + IsEnabled bool `json:"is_enabled"` // Whether or not the issue type is enabled at the organization level. (Required.) + IsPrivate *bool `json:"is_private,omitempty"` // Whether or not the issue type is restricted to issues in private repositories. (Optional.) + Description *string `json:"description,omitempty"` // Description of the issue type. (Optional.) + Color *string `json:"color,omitempty"` // Color for the issue type. Can be one of "gray", "blue", green "orange", "red", "pink", "purple", "null". (Optional.) +} + +// ListIssueTypes lists all issue types for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization +// +//meta:operation GET /orgs/{org}/issue-types +func (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ([]*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var issueTypes []*IssueType + resp, err := s.client.Do(ctx, req, &issueTypes) + if err != nil { + return nil, resp, err + } + + return issueTypes, resp, nil +} + +// CreateIssueType creates a new issue type for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization +// +//meta:operation POST /orgs/{org}/issue-types +func (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, opt *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types", org) + req, err := s.client.NewRequest("POST", u, opt) + if err != nil { + return nil, nil, err + } + + issueType := new(IssueType) + resp, err := s.client.Do(ctx, req, issueType) + if err != nil { + return nil, resp, err + } + + return issueType, resp, nil +} + +// UpdateIssueType updates GitHub Pages for the named repo. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization +// +//meta:operation PUT /orgs/{org}/issue-types/{issue_type_id} +func (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, issueTypeID int64, opt *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types/%v", org, issueTypeID) + req, err := s.client.NewRequest("PUT", u, opt) + if err != nil { + return nil, nil, err + } + + issueType := new(IssueType) + resp, err := s.client.Do(ctx, req, issueType) + if err != nil { + return nil, resp, err + } + + return issueType, resp, nil +} + +// DeleteIssueType deletes an issue type for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization +// +//meta:operation DELETE /orgs/{org}/issue-types/{issue_type_id} +func (s *OrganizationsService) DeleteIssueType(ctx context.Context, org string, issueTypeID int64) (*Response, error) { + u := fmt.Sprintf("orgs/%v/issue-types/%d", org, issueTypeID) + 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/v69/github/orgs_members.go b/vendor/github.com/google/go-github/v75/github/orgs_members.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_members.go rename to vendor/github.com/google/go-github/v75/github/orgs_members.go diff --git a/vendor/github.com/google/go-github/v75/github/orgs_network_configurations.go b/vendor/github.com/google/go-github/v75/github/orgs_network_configurations.go new file mode 100644 index 000000000..82a819c20 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/orgs_network_configurations.go @@ -0,0 +1,236 @@ +// Copyright 2025 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" + "errors" + "fmt" + "regexp" +) + +// ComputeService represents a hosted compute service the network configuration supports. +type ComputeService string + +const ( + ComputeServiceNone ComputeService = "none" + ComputeServiceActions ComputeService = "actions" + ComputeServiceCodespaces ComputeService = "codespaces" +) + +// NetworkConfigurations represents a hosted compute network configuration. This type is identical +// for enterprise and organization endpoints. +type NetworkConfigurations struct { + TotalCount *int64 `json:"total_count,omitempty"` + NetworkConfigurations []*NetworkConfiguration `json:"network_configurations,omitempty"` +} + +// NetworkConfiguration represents a hosted compute network configurations. This type is identical +// for enterprise and organization endpoints. +type NetworkConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` + CreatedOn *Timestamp `json:"created_on"` +} + +// NetworkSettingsResource represents a hosted compute network settings resource. This type is identical +// for enterprise and organization endpoints. +type NetworkSettingsResource struct { + ID *string `json:"id,omitempty"` + NetworkConfigurationID *string `json:"network_configuration_id,omitempty"` + Name *string `json:"name,omitempty"` + SubnetID *string `json:"subnet_id,omitempty"` + Region *string `json:"region,omitempty"` +} + +func validateComputeService(compute *ComputeService) error { + if compute == nil { + return nil + } + if *compute != ComputeServiceNone && *compute != ComputeServiceActions { + return errors.New("compute service can only be one of: none, actions") + } + return nil +} + +var validNetworkNameRE = regexp.MustCompile(`^[a-zA-Z0-9._-]+$`) + +func validateNetworkName(name string) error { + if len(name) < 1 || len(name) > 100 { + return errors.New("must be between 1 and 100 characters") + } + if !validNetworkNameRE.MatchString(name) { + return errors.New("may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'") + } + return nil +} + +func validateNetworkSettingsID(settingsID []string) error { + if len(settingsID) != 1 { + return errors.New("exactly one network settings id must be specified") + } + return nil +} + +func validateNetworkConfigurationRequest(req NetworkConfigurationRequest) error { + networkName := req.GetName() + if err := validateNetworkName(networkName); err != nil { + return err + } + + computeService := req.GetComputeService() + if err := validateComputeService(computeService); err != nil { + return err + } + + networkIDs := req.NetworkSettingsIDs + if err := validateNetworkSettingsID(networkIDs); err != nil { + return err + } + return nil +} + +// NetworkConfigurationRequest represents a request to create or update a network configuration for an organization. +type NetworkConfigurationRequest struct { + Name *string `json:"name,omitempty"` + ComputeService *ComputeService `json:"compute_service,omitempty"` + NetworkSettingsIDs []string `json:"network_settings_ids,omitempty"` +} + +// ListNetworkConfigurations lists all hosted compute network configurations configured in an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-configurations +func (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, org string, opts *ListOptions) (*NetworkConfigurations, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations", 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 + } + + configurations := &NetworkConfigurations{} + resp, err := s.client.Do(ctx, req, configurations) + if err != nil { + return nil, resp, err + } + return configurations, resp, nil +} + +// CreateNetworkConfiguration creates a hosted compute network configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation POST /orgs/{org}/settings/network-configurations +func (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, org string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(createReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/settings/network-configurations", org) + req, err := s.client.NewRequest("POST", u, createReq) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// GetNetworkConfiguration gets a hosted compute network configuration configured in an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, networkID string) (*NetworkConfiguration, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// UpdateNetworkConfiguration updates a hosted compute network configuration for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization +// +//meta:operation PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, org, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) { + if err := validateNetworkConfigurationRequest(updateReq); err != nil { + return nil, nil, fmt.Errorf("validation failed: %w", err) + } + + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("PATCH", u, updateReq) + if err != nil { + return nil, nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return nil, resp, err + } + return configuration, resp, nil +} + +// DeleteNetworkConfigurations deletes a hosted compute network configuration from an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization +// +//meta:operation DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id} +func (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, org, networkID string) (*Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-configurations/%v", org, networkID) + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + configuration := &NetworkConfiguration{} + resp, err := s.client.Do(ctx, req, configuration) + if err != nil { + return resp, err + } + return resp, nil +} + +// GetNetworkConfigurationResource gets a hosted compute network settings resource configured for an organization. +// +// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization +// +//meta:operation GET /orgs/{org}/settings/network-settings/{network_settings_id} +func (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Context, org, networkID string) (*NetworkSettingsResource, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/network-settings/%v", org, networkID) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + resource := &NetworkSettingsResource{} + resp, err := s.client.Do(ctx, req, resource) + if err != nil { + return nil, resp, err + } + return resource, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/orgs_organization_roles.go b/vendor/github.com/google/go-github/v75/github/orgs_organization_roles.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_organization_roles.go rename to vendor/github.com/google/go-github/v75/github/orgs_organization_roles.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_outside_collaborators.go b/vendor/github.com/google/go-github/v75/github/orgs_outside_collaborators.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/orgs_outside_collaborators.go rename to vendor/github.com/google/go-github/v75/github/orgs_outside_collaborators.go index 56034d726..72f885fed 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_outside_collaborators.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_outside_collaborators.go @@ -57,7 +57,7 @@ func (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org // GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization // //meta:operation DELETE /orgs/{org}/outside_collaborators/{username} -func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { +func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) if err != nil { @@ -76,7 +76,7 @@ func (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, or // GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator // //meta:operation PUT /orgs/{org}/outside_collaborators/{username} -func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org string, user string) (*Response, error) { +func (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/outside_collaborators/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/orgs_packages.go b/vendor/github.com/google/go-github/v75/github/orgs_packages.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_packages.go rename to vendor/github.com/google/go-github/v75/github/orgs_packages.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_personal_access_tokens.go b/vendor/github.com/google/go-github/v75/github/orgs_personal_access_tokens.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/orgs_personal_access_tokens.go rename to vendor/github.com/google/go-github/v75/github/orgs_personal_access_tokens.go index 276fbbb49..4abd6665a 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_personal_access_tokens.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_personal_access_tokens.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -155,6 +156,10 @@ func addListFineGrainedPATOptions(s string, opts *ListFineGrainedPATOptions) (st return s, err } + if opts == nil { + return "", errors.New("opts must be provided") + } + if len(opts.Owner) > 0 { ownerVals := make([]string, len(opts.Owner)) for i, owner := range opts.Owner { diff --git a/vendor/github.com/google/go-github/v69/github/orgs_properties.go b/vendor/github.com/google/go-github/v75/github/orgs_properties.go similarity index 94% rename from vendor/github.com/google/go-github/v69/github/orgs_properties.go rename to vendor/github.com/google/go-github/v75/github/orgs_properties.go index f59d9f467..257e76599 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_properties.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_properties.go @@ -44,8 +44,15 @@ type RepoCustomPropertyValue struct { // CustomPropertyValue represents a custom property value. type CustomPropertyValue struct { - PropertyName string `json:"property_name"` - Value interface{} `json:"value"` + PropertyName string `json:"property_name"` + Value any `json:"value"` +} + +// ListCustomPropertyValuesOptions specifies the optional parameters to the +// OrganizationsService.ListCustomPropertyValues method. +type ListCustomPropertyValuesOptions struct { + RepositoryQuery string `url:"repository_query,omitempty"` + ListOptions } // UnmarshalJSON implements the json.Unmarshaler interface. @@ -66,7 +73,7 @@ func (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error { cpv.Value = nil case string: cpv.Value = v - case []interface{}: + case []any: strSlice := make([]string, len(v)) for i, item := range v { str, ok := item.(string) @@ -197,7 +204,7 @@ func (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, cu // GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories // //meta:operation GET /orgs/{org}/properties/values -func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListOptions) ([]*RepoCustomPropertyValue, *Response, error) { +func (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) ([]*RepoCustomPropertyValue, *Response, error) { u := fmt.Sprintf("orgs/%v/properties/values", org) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/orgs_rules.go b/vendor/github.com/google/go-github/v75/github/orgs_rules.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/orgs_rules.go rename to vendor/github.com/google/go-github/v75/github/orgs_rules.go index 8cb2e5d1f..357eb8ce7 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_rules.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_rules.go @@ -15,9 +15,14 @@ import ( // GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets // //meta:operation GET /orgs/{org}/rulesets -func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string) ([]*RepositoryRuleset, *Response, error) { +func (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) { u := fmt.Sprintf("orgs/%v/rulesets", 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 diff --git a/vendor/github.com/google/go-github/v69/github/orgs_security_managers.go b/vendor/github.com/google/go-github/v75/github/orgs_security_managers.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/orgs_security_managers.go rename to vendor/github.com/google/go-github/v75/github/orgs_security_managers.go diff --git a/vendor/github.com/google/go-github/v69/github/orgs_users_blocking.go b/vendor/github.com/google/go-github/v75/github/orgs_users_blocking.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/orgs_users_blocking.go rename to vendor/github.com/google/go-github/v75/github/orgs_users_blocking.go index 62bd9116c..f69933ba4 100644 --- a/vendor/github.com/google/go-github/v69/github/orgs_users_blocking.go +++ b/vendor/github.com/google/go-github/v75/github/orgs_users_blocking.go @@ -44,7 +44,7 @@ func (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, // GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization // //meta:operation GET /orgs/{org}/blocks/{username} -func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user string) (bool, *Response, error) { +func (s *OrganizationsService) IsBlocked(ctx context.Context, org, user string) (bool, *Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) req, err := s.client.NewRequest("GET", u, nil) @@ -65,7 +65,7 @@ func (s *OrganizationsService) IsBlocked(ctx context.Context, org string, user s // GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization // //meta:operation PUT /orgs/{org}/blocks/{username} -func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user string) (*Response, error) { +func (s *OrganizationsService) BlockUser(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) req, err := s.client.NewRequest("PUT", u, nil) @@ -84,7 +84,7 @@ func (s *OrganizationsService) BlockUser(ctx context.Context, org string, user s // GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization // //meta:operation DELETE /orgs/{org}/blocks/{username} -func (s *OrganizationsService) UnblockUser(ctx context.Context, org string, user string) (*Response, error) { +func (s *OrganizationsService) UnblockUser(ctx context.Context, org, user string) (*Response, error) { u := fmt.Sprintf("orgs/%v/blocks/%v", org, user) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v75/github/packages.go b/vendor/github.com/google/go-github/v75/github/packages.go new file mode 100644 index 000000000..cc04a044d --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/packages.go @@ -0,0 +1,319 @@ +// Copyright 2020 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" +) + +// Package represents a GitHub package. +type Package struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + PackageType *string `json:"package_type,omitempty"` // One of "npm", "maven", "rubygems", "docker", "nuget", "container". For webhook events "container" is "CONTAINER" + HTMLURL *string `json:"html_url,omitempty"` + Visibility *string `json:"visibility,omitempty"` + Owner *User `json:"owner,omitempty"` + Repository *Repository `json:"repository,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + + // The following are only populated for webhook events + Namespace *string `json:"namespace,omitempty"` + Description *string `json:"description,omitempty"` + Ecosystem *string `json:"ecosystem,omitempty"` + PackageVersion *PackageVersion `json:"package_version,omitempty"` + Registry *PackageRegistry `json:"registry,omitempty"` + + // The following are NOT populated for webhook events + URL *string `json:"url,omitempty"` + VersionCount *int64 `json:"version_count,omitempty"` +} + +func (p Package) String() string { + return Stringify(p) +} + +// PackageVersion represents a GitHub package version. +type PackageVersion struct { + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + URL *string `json:"url,omitempty"` + PackageHTMLURL *string `json:"package_html_url,omitempty"` + License *string `json:"license,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + Metadata json.RawMessage `json:"metadata,omitempty"` // For webhook events this will be []interface, else it will be of type PackageMetadata + + // The following are only populated for webhook events + Version *string `json:"version,omitempty"` + Summary *string `json:"summary,omitempty"` + Body json.RawMessage `json:"body,omitempty"` // Can either be a string or of type PackageVersionBody + BodyHTML *string `json:"body_html,omitempty"` + Release *PackageRelease `json:"release,omitempty"` + Manifest *string `json:"manifest,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + TargetOID *string `json:"target_oid,omitempty"` + Draft *bool `json:"draft,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + ContainerMetadata *PackageEventContainerMetadata `json:"container_metadata,omitempty"` + DockerMetadata []any `json:"docker_metadata,omitempty"` + NPMMetadata *PackageNPMMetadata `json:"npm_metadata,omitempty"` + NugetMetadata []*PackageNugetMetadata `json:"nuget_metadata,omitempty"` + RubyMetadata map[string]any `json:"ruby_metadata,omitempty"` + PackageFiles []*PackageFile `json:"package_files,omitempty"` + PackageURL *string `json:"package_url,omitempty"` + Author *User `json:"author,omitempty"` + SourceURL *string `json:"source_url,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + + // The following are NOT populated for webhook events + DeletedAt *Timestamp `json:"deleted_at,omitempty"` +} + +// GetBody returns the body field as a string if it's valid. +func (pv *PackageVersion) GetBody() (body string, ok bool) { + if pv == nil || pv.Body == nil { + return "", false + } + + if err := json.Unmarshal(pv.Body, &body); err != nil { + return "", false + } + + return body, true +} + +// GetBodyAsPackageVersionBody returns the body field as a PackageVersionBody if it's valid. +func (pv *PackageVersion) GetBodyAsPackageVersionBody() (body *PackageVersionBody, ok bool) { + if pv == nil || pv.Body == nil { + return nil, false + } + + if err := json.Unmarshal(pv.Body, &body); err != nil { + return nil, false + } + + return body, true +} + +// GetMetadata returns the metadata field as PackageMetadata if it's valid. +func (pv *PackageVersion) GetMetadata() (metadata *PackageMetadata, ok bool) { + if pv == nil || pv.Metadata == nil { + return nil, false + } + + if err := json.Unmarshal(pv.Metadata, &metadata); err != nil { + return nil, false + } + + return metadata, true +} + +// GetRawMetadata returns the metadata field as a json.RawMessage. +func (pv *PackageVersion) GetRawMetadata() json.RawMessage { + if pv == nil || pv.Metadata == nil { + return json.RawMessage{} + } + + return pv.Metadata +} + +func (pv PackageVersion) String() string { + return Stringify(pv) +} + +// PackageRelease represents a GitHub package version release. +type PackageRelease struct { + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + ID *int64 `json:"id,omitempty"` + TagName *string `json:"tag_name,omitempty"` + TargetCommitish *string `json:"target_commitish,omitempty"` + Name *string `json:"name,omitempty"` + Draft *bool `json:"draft,omitempty"` + Author *User `json:"author,omitempty"` + Prerelease *bool `json:"prerelease,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + PublishedAt *Timestamp `json:"published_at,omitempty"` +} + +func (r PackageRelease) String() string { + return Stringify(r) +} + +// PackageFile represents a GitHub package version release file. +type PackageFile struct { + DownloadURL *string `json:"download_url,omitempty"` + ID *int64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + SHA256 *string `json:"sha256,omitempty"` + SHA1 *string `json:"sha1,omitempty"` + MD5 *string `json:"md5,omitempty"` + ContentType *string `json:"content_type,omitempty"` + State *string `json:"state,omitempty"` + Author *User `json:"author,omitempty"` + Size *int64 `json:"size,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` +} + +func (pf PackageFile) String() string { + return Stringify(pf) +} + +// PackageRegistry represents a GitHub package registry. +type PackageRegistry struct { + AboutURL *string `json:"about_url,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + URL *string `json:"url,omitempty"` + Vendor *string `json:"vendor,omitempty"` +} + +func (r PackageRegistry) String() string { + return Stringify(r) +} + +// PackageListOptions represents the optional list options for a package. +type PackageListOptions struct { + // Visibility of packages "public", "internal" or "private". + Visibility *string `url:"visibility,omitempty"` + + // PackageType represents the type of package. + // It can be one of "npm", "maven", "rubygems", "nuget", "docker", or "container". + PackageType *string `url:"package_type,omitempty"` + + // State of package either "active" or "deleted". + State *string `url:"state,omitempty"` + + ListOptions +} + +// PackageMetadata represents metadata from a package. +type PackageMetadata struct { + PackageType *string `json:"package_type,omitempty"` + Container *PackageContainerMetadata `json:"container,omitempty"` +} + +func (r PackageMetadata) String() string { + return Stringify(r) +} + +// PackageContainerMetadata represents container metadata for docker container packages. +type PackageContainerMetadata struct { + Tags []string `json:"tags,omitempty"` +} + +func (r PackageContainerMetadata) String() string { + return Stringify(r) +} + +// PackageVersionBody represents the body field of a package version. +type PackageVersionBody struct { + Repo *Repository `json:"repository,omitempty"` + Info *PackageVersionBodyInfo `json:"info,omitempty"` +} + +func (b PackageVersionBody) String() string { + return Stringify(b) +} + +// PackageVersionBodyInfo represents the info field of a PackageVersionBody. +type PackageVersionBodyInfo struct { + Type *string `json:"type,omitempty"` + OID *string `json:"oid,omitempty"` + Mode *int64 `json:"mode,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Size *int64 `json:"size,omitempty"` + Collection *bool `json:"collection,omitempty"` +} + +func (bi PackageVersionBodyInfo) String() string { + return Stringify(bi) +} + +// PackageEventContainerMetadata represents metadata for container packages as part of a webhook event. +// See also PackageContainerMetadata. +type PackageEventContainerMetadata struct { + Labels map[string]any `json:"labels,omitempty"` + Manifest map[string]any `json:"manifest,omitempty"` + Tag *PackageEventContainerMetadataTag `json:"tag,omitempty"` +} + +func (m PackageEventContainerMetadata) String() string { + return Stringify(m) +} + +// PackageEventContainerMetadataTag represents a tag of a GitHub container package. +type PackageEventContainerMetadataTag struct { + Name *string `json:"name,omitempty"` + Digest *string `json:"digest,omitempty"` +} + +func (mt PackageEventContainerMetadataTag) String() string { + return Stringify(mt) +} + +// PackageNugetMetadata represents nuget metadata for a GitHub package. +type PackageNugetMetadata struct { + ID json.RawMessage `json:"id,omitempty"` // Can either be a int64 or string + Name *string `json:"name,omitempty"` + Value json.RawMessage `json:"value,omitempty"` // Can either be a bool, string, integer or object +} + +func (nm PackageNugetMetadata) String() string { + return Stringify(nm) +} + +// PackageNPMMetadata represents NPM metadata for a GitHub package. +type PackageNPMMetadata struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + NPMUser *string `json:"npm_user,omitempty"` + Author map[string]string `json:"author,omitempty"` + Bugs map[string]string `json:"bugs,omitempty"` + Dependencies map[string]string `json:"dependencies,omitempty"` + DevDependencies map[string]string `json:"dev_dependencies,omitempty"` + PeerDependencies map[string]string `json:"peer_dependencies,omitempty"` + OptionalDependencies map[string]string `json:"optional_dependencies,omitempty"` + Description *string `json:"description,omitempty"` + Dist map[string]string `json:"dist,omitempty"` + GitHead *string `json:"git_head,omitempty"` + Homepage *string `json:"homepage,omitempty"` + License *string `json:"license,omitempty"` + Main *string `json:"main,omitempty"` + Repository map[string]string `json:"repository,omitempty"` + Scripts map[string]any `json:"scripts,omitempty"` + ID *string `json:"id,omitempty"` + NodeVersion *string `json:"node_version,omitempty"` + NPMVersion *string `json:"npm_version,omitempty"` + HasShrinkwrap *bool `json:"has_shrinkwrap,omitempty"` + Maintainers []any `json:"maintainers,omitempty"` + Contributors []any `json:"contributors,omitempty"` + Engines map[string]string `json:"engines,omitempty"` + Keywords []string `json:"keywords,omitempty"` + Files []string `json:"files,omitempty"` + Bin map[string]any `json:"bin,omitempty"` + Man map[string]any `json:"man,omitempty"` + Directories map[string]string `json:"directories,omitempty"` + OS []string `json:"os,omitempty"` + CPU []string `json:"cpu,omitempty"` + Readme *string `json:"readme,omitempty"` + InstallationCommand *string `json:"installation_command,omitempty"` + ReleaseID *int64 `json:"release_id,omitempty"` + CommitOID *string `json:"commit_oid,omitempty"` + PublishedViaActions *bool `json:"published_via_actions,omitempty"` + DeletedByID *int64 `json:"deleted_by_id,omitempty"` +} + +func (nm PackageNPMMetadata) String() string { + return Stringify(nm) +} diff --git a/vendor/github.com/google/go-github/v69/github/pulls.go b/vendor/github.com/google/go-github/v75/github/pulls.go similarity index 84% rename from vendor/github.com/google/go-github/v69/github/pulls.go rename to vendor/github.com/google/go-github/v75/github/pulls.go index f3c6e929c..48717941f 100644 --- a/vendor/github.com/google/go-github/v69/github/pulls.go +++ b/vendor/github.com/google/go-github/v75/github/pulls.go @@ -28,32 +28,38 @@ type PullRequestAutoMerge struct { // PullRequest represents a GitHub pull request on a repository. type PullRequest struct { - ID *int64 `json:"id,omitempty"` - Number *int `json:"number,omitempty"` - State *string `json:"state,omitempty"` - Locked *bool `json:"locked,omitempty"` - Title *string `json:"title,omitempty"` - Body *string `json:"body,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - ClosedAt *Timestamp `json:"closed_at,omitempty"` - MergedAt *Timestamp `json:"merged_at,omitempty"` - Labels []*Label `json:"labels,omitempty"` - User *User `json:"user,omitempty"` - Draft *bool `json:"draft,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - IssueURL *string `json:"issue_url,omitempty"` - StatusesURL *string `json:"statuses_url,omitempty"` - DiffURL *string `json:"diff_url,omitempty"` - PatchURL *string `json:"patch_url,omitempty"` - CommitsURL *string `json:"commits_url,omitempty"` - CommentsURL *string `json:"comments_url,omitempty"` - ReviewCommentsURL *string `json:"review_comments_url,omitempty"` - ReviewCommentURL *string `json:"review_comment_url,omitempty"` - Assignee *User `json:"assignee,omitempty"` - Assignees []*User `json:"assignees,omitempty"` - Milestone *Milestone `json:"milestone,omitempty"` + ID *int64 `json:"id,omitempty"` + Number *int `json:"number,omitempty"` + State *string `json:"state,omitempty"` + Locked *bool `json:"locked,omitempty"` + Title *string `json:"title,omitempty"` + Body *string `json:"body,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + ClosedAt *Timestamp `json:"closed_at,omitempty"` + MergedAt *Timestamp `json:"merged_at,omitempty"` + Labels []*Label `json:"labels,omitempty"` + User *User `json:"user,omitempty"` + Draft *bool `json:"draft,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + IssueURL *string `json:"issue_url,omitempty"` + StatusesURL *string `json:"statuses_url,omitempty"` + DiffURL *string `json:"diff_url,omitempty"` + PatchURL *string `json:"patch_url,omitempty"` + CommitsURL *string `json:"commits_url,omitempty"` + CommentsURL *string `json:"comments_url,omitempty"` + ReviewCommentsURL *string `json:"review_comments_url,omitempty"` + ReviewCommentURL *string `json:"review_comment_url,omitempty"` + Assignee *User `json:"assignee,omitempty"` + Assignees []*User `json:"assignees,omitempty"` + Milestone *Milestone `json:"milestone,omitempty"` + // AuthorAssociation is the pull request author's relationship to the repository. + // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Pull Requests REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/pulls/pulls#get-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` NodeID *string `json:"node_id,omitempty"` RequestedReviewers []*User `json:"requested_reviewers,omitempty"` @@ -148,7 +154,7 @@ type PullRequestListOptions struct { // GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests // //meta:operation GET /repos/{owner}/{repo}/pulls -func (s *PullRequestsService) List(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { +func (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -207,7 +213,7 @@ func (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, ow // GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} -func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string, number int) (*PullRequest, *Response, error) { +func (s *PullRequestsService) Get(ctx context.Context, owner, repo string, number int) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -228,7 +234,7 @@ func (s *PullRequestsService) Get(ctx context.Context, owner string, repo string // GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number} -func (s *PullRequestsService) GetRaw(ctx context.Context, owner string, repo string, number int, opts RawOptions) (string, *Response, error) { +func (s *PullRequestsService) GetRaw(ctx context.Context, owner, repo string, number int, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -277,7 +283,7 @@ type NewPullRequest struct { // GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request // //meta:operation POST /repos/{owner}/{repo}/pulls -func (s *PullRequestsService) Create(ctx context.Context, owner string, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { +func (s *PullRequestsService) Create(ctx context.Context, owner, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls", owner, repo) req, err := s.client.NewRequest("POST", u, pull) if err != nil { @@ -355,7 +361,7 @@ type pullRequestUpdate struct { // GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request // //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) { +func (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) { if pull == nil { return nil, nil, errors.New("pull must be provided") } @@ -394,7 +400,7 @@ func (s *PullRequestsService) Edit(ctx context.Context, owner string, repo strin // GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/commits -func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { +func (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/commits", owner, repo, number) u, err := addOptions(u, opts) if err != nil { @@ -420,7 +426,7 @@ func (s *PullRequestsService) ListCommits(ctx context.Context, owner string, rep // GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/files -func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { +func (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/files", owner, repo, number) u, err := addOptions(u, opts) if err != nil { @@ -446,7 +452,7 @@ func (s *PullRequestsService) ListFiles(ctx context.Context, owner string, repo // GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged // //meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/merge -func (s *PullRequestsService) IsMerged(ctx context.Context, owner string, repo string, number int) (bool, *Response, error) { +func (s *PullRequestsService) IsMerged(ctx context.Context, owner, repo string, number int) (bool, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -490,7 +496,7 @@ type pullRequestMergeRequest struct { // GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request // //meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge -func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { +func (s *PullRequestsService) Merge(ctx context.Context, owner, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/%d/merge", owner, repo, number) pullRequestBody := &pullRequestMergeRequest{} diff --git a/vendor/github.com/google/go-github/v69/github/pulls_comments.go b/vendor/github.com/google/go-github/v75/github/pulls_comments.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/pulls_comments.go rename to vendor/github.com/google/go-github/v75/github/pulls_comments.go index a9ffe8d7c..431b45088 100644 --- a/vendor/github.com/google/go-github/v69/github/pulls_comments.go +++ b/vendor/github.com/google/go-github/v75/github/pulls_comments.go @@ -37,6 +37,10 @@ type PullRequestComment struct { UpdatedAt *Timestamp `json:"updated_at,omitempty"` // AuthorAssociation is the comment author's relationship to the pull request's repository. // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Pull Request Comments REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` URL *string `json:"url,omitempty"` HTMLURL *string `json:"html_url,omitempty"` diff --git a/vendor/github.com/google/go-github/v69/github/pulls_reviewers.go b/vendor/github.com/google/go-github/v75/github/pulls_reviewers.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/pulls_reviewers.go rename to vendor/github.com/google/go-github/v75/github/pulls_reviewers.go diff --git a/vendor/github.com/google/go-github/v69/github/pulls_reviews.go b/vendor/github.com/google/go-github/v75/github/pulls_reviews.go similarity index 96% rename from vendor/github.com/google/go-github/v69/github/pulls_reviews.go rename to vendor/github.com/google/go-github/v75/github/pulls_reviews.go index 27b8dc37d..84e06a0ea 100644 --- a/vendor/github.com/google/go-github/v69/github/pulls_reviews.go +++ b/vendor/github.com/google/go-github/v75/github/pulls_reviews.go @@ -24,8 +24,12 @@ type PullRequestReview struct { HTMLURL *string `json:"html_url,omitempty"` PullRequestURL *string `json:"pull_request_url,omitempty"` State *string `json:"state,omitempty"` - // AuthorAssociation is the comment author's relationship to the issue's repository. + // AuthorAssociation is the review author's relationship to the repository. // Possible values are "COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MEMBER", "OWNER", or "NONE". + // + // Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025. + // Use the Pull Request Reviews REST API endpoint to retrieve this information. + // See: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request AuthorAssociation *string `json:"author_association,omitempty"` } diff --git a/vendor/github.com/google/go-github/v69/github/pulls_threads.go b/vendor/github.com/google/go-github/v75/github/pulls_threads.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/pulls_threads.go rename to vendor/github.com/google/go-github/v75/github/pulls_threads.go diff --git a/vendor/github.com/google/go-github/v69/github/rate_limit.go b/vendor/github.com/google/go-github/v75/github/rate_limit.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/rate_limit.go rename to vendor/github.com/google/go-github/v75/github/rate_limit.go diff --git a/vendor/github.com/google/go-github/v69/github/reactions.go b/vendor/github.com/google/go-github/v75/github/reactions.go similarity index 89% rename from vendor/github.com/google/go-github/v69/github/reactions.go rename to vendor/github.com/google/go-github/v75/github/reactions.go index 9f9f72fae..5233f78d3 100644 --- a/vendor/github.com/google/go-github/v69/github/reactions.go +++ b/vendor/github.com/google/go-github/v75/github/reactions.go @@ -26,7 +26,8 @@ type Reaction struct { // Content is the type of reaction. // Possible values are: // "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". - Content *string `json:"content,omitempty"` + Content *string `json:"content,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` } // Reactions represents a summary of GitHub reactions. @@ -47,9 +48,8 @@ func (r Reaction) String() string { return Stringify(r) } -// ListCommentReactionOptions specifies the optional parameters to the -// ReactionsService.ListCommentReactions method. -type ListCommentReactionOptions struct { +// ListReactionOptions specifies the optional parameters to the list reactions endpoints. +type ListReactionOptions struct { // Content restricts the returned comment reactions to only those with the given type. // Omit this parameter to list all reactions to a commit comment. // Possible values are: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". @@ -63,7 +63,7 @@ type ListCommentReactionOptions struct { // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment // //meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions -func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListCommentReactionOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -143,7 +143,7 @@ func (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue // //meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions -func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%v/reactions", owner, repo, number) u, err := addOptions(u, opts) if err != nil { @@ -223,7 +223,7 @@ func (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment // //meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions -func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -303,7 +303,7 @@ func (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, r // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment // //meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions -func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("repos/%v/%v/pulls/comments/%v/reactions", owner, repo, id) u, err := addOptions(u, opts) if err != nil { @@ -383,7 +383,7 @@ func (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Cont // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy // //meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions -func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/reactions", teamID, discussionNumber) u, err := addOptions(u, opts) if err != nil { @@ -459,7 +459,7 @@ func (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx cont // GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy // //meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions -func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListOptions) ([]*Reaction, *Response, error) { +func (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) { u := fmt.Sprintf("teams/%v/discussions/%v/comments/%v/reactions", teamID, discussionNumber, commentNumber) u, err := addOptions(u, opts) if err != nil { @@ -568,3 +568,54 @@ func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, rep return m, resp, nil } + +// ListReleaseReactions lists the reactions for a release. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release +// +//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/reactions +func (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo string, releaseID int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) + 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 + } + + // TODO: remove custom Accept headers when APIs fully launch. + req.Header.Set("Accept", mediaTypeReactionsPreview) + + var m []*Reaction + resp, err := s.client.Do(ctx, req, &m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} + +// DeleteReleaseReaction deletes the reaction for a release. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} +func (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, repo string, releaseID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions/%v", owner, repo, releaseID, reactionID) + + return s.deleteReaction(ctx, u) +} + +// DeleteReleaseReactionByID deletes the reaction for a release by repository ID. +// +// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction +// +//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id} +func (s *ReactionsService) DeleteReleaseReactionByID(ctx context.Context, repoID, releaseID, reactionID int64) (*Response, error) { + u := fmt.Sprintf("repositories/%v/releases/%v/reactions/%v", repoID, releaseID, reactionID) + + return s.deleteReaction(ctx, u) +} diff --git a/vendor/github.com/google/go-github/v69/github/repos.go b/vendor/github.com/google/go-github/v75/github/repos.go similarity index 90% rename from vendor/github.com/google/go-github/v69/github/repos.go rename to vendor/github.com/google/go-github/v75/github/repos.go index 9faed401f..26dc657f0 100644 --- a/vendor/github.com/google/go-github/v69/github/repos.go +++ b/vendor/github.com/google/go-github/v75/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]interface{} `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]any `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"` @@ -536,6 +536,10 @@ type createRepoRequest struct { //meta:operation POST /orgs/{org}/repos //meta:operation POST /user/repos func (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) { + if repo == nil { + return nil, nil, errors.New("repository must be provided") + } + var u string if org != "" { u = fmt.Sprintf("orgs/%v/repos", org) @@ -833,7 +837,7 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow // GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository // //meta:operation GET /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) { @@ -854,7 +858,7 @@ func (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, own // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates // //meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -870,7 +874,7 @@ func (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, // DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository. // -// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-automated-security-fixes +// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates // //meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) { @@ -889,7 +893,7 @@ func (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, // GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors // //meta:operation GET /repos/{owner}/{repo}/contributors -func (s *RepositoriesService) ListContributors(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { +func (s *RepositoriesService) ListContributors(ctx context.Context, owner, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) { u := fmt.Sprintf("repos/%v/%v/contributors", owner, repository) u, err := addOptions(u, opts) if err != nil { @@ -922,7 +926,7 @@ func (s *RepositoriesService) ListContributors(ctx context.Context, owner string // GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages // //meta:operation GET /repos/{owner}/{repo}/languages -func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, repo string) (map[string]int, *Response, error) { +func (s *RepositoriesService) ListLanguages(ctx context.Context, owner, repo string) (map[string]int, *Response, error) { u := fmt.Sprintf("repos/%v/%v/languages", owner, repo) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -943,7 +947,7 @@ func (s *RepositoriesService) ListLanguages(ctx context.Context, owner string, r // GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams // //meta:operation GET /repos/{owner}/{repo}/teams -func (s *RepositoriesService) ListTeams(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Team, *Response, error) { +func (s *RepositoriesService) ListTeams(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Team, *Response, error) { u := fmt.Sprintf("repos/%v/%v/teams", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -977,7 +981,7 @@ type RepositoryTag struct { // GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags // //meta:operation GET /repos/{owner}/{repo}/tags -func (s *RepositoriesService) ListTags(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { +func (s *RepositoriesService) ListTags(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) { u := fmt.Sprintf("repos/%v/%v/tags", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -1010,7 +1014,8 @@ type Branch struct { // 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 *Protection `json:"protection,omitempty"` + ProtectionURL *string `json:"protection_url,omitempty"` } // Protection represents a repository branch's protection. @@ -1073,6 +1078,7 @@ type BranchProtectionRule struct { RequiredConversationResolutionLevel *string `json:"required_conversation_resolution_level,omitempty"` AuthorizedActorsOnly *bool `json:"authorized_actors_only,omitempty"` AuthorizedActorNames []string `json:"authorized_actor_names,omitempty"` + RequireLastPushApproval *bool `json:"require_last_push_approval,omitempty"` } // ProtectionChanges represents the changes to the rule if the BranchProtection was edited. @@ -1092,6 +1098,7 @@ type ProtectionChanges struct { RequiredStatusChecks *RequiredStatusChecksChanges `json:"required_status_checks,omitempty"` RequiredStatusChecksEnforcementLevel *RequiredStatusChecksEnforcementLevelChanges `json:"required_status_checks_enforcement_level,omitempty"` SignatureRequirementEnforcementLevel *SignatureRequirementEnforcementLevelChanges `json:"signature_requirement_enforcement_level,omitempty"` + RequireLastPushApproval *RequireLastPushApprovalChanges `json:"require_last_push_approval,omitempty"` } // AdminEnforcedChanges represents the changes made to the AdminEnforced policy. @@ -1169,6 +1176,11 @@ type SignatureRequirementEnforcementLevelChanges struct { From *string `json:"from,omitempty"` } +// RequireLastPushApprovalChanges represents the changes made to the RequireLastPushApproval policy. +type RequireLastPushApprovalChanges struct { + From *bool `json:"from,omitempty"` +} + // ProtectionRequest represents a request to create/edit a branch's protection. type ProtectionRequest struct { RequiredStatusChecks *RequiredStatusChecks `json:"required_status_checks"` @@ -1403,7 +1415,7 @@ type AutomatedSecurityFixes struct { // GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches // //meta:operation GET /repos/{owner}/{repo}/branches -func (s *RepositoriesService) ListBranches(ctx context.Context, owner string, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { +func (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) { u := fmt.Sprintf("repos/%v/%v/branches", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -2426,3 +2438,99 @@ func (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, own resp, err := s.client.Do(ctx, req, privateReporting) return privateReporting.Enabled, resp, err } + +// ListRepositoryActivityOptions specifies the optional parameters to the +// RepositoriesService.ListRepositoryActivities method. +type ListRepositoryActivityOptions struct { + // The direction to sort the results by. + // Default: desc + // Can be one of: asc, desc + Direction string `url:"direction,omitempty"` + + // For paginated result sets, The number of results per page (max 100). + PerPage int `url:"per_page,omitempty"` + + // A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. + Before string `url:"before,omitempty"` + + // A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. + After string `url:"after,omitempty"` + + // The Git reference for the activities you want to list. + // The ref for a branch can be formatted either as refs/heads/BRANCH_NAME or BRANCH_NAME, where BRANCH_NAME is the name of your branch. + Ref string `url:"ref,omitempty"` + + // The GitHub username to use to filter by the actor who performed the activity. + Actor string `url:"actor,omitempty"` + + // The time period to filter by. + // For example, day will filter for activity that occurred in the past 24 hours, and week will filter for activity that occurred in the past 7 days (168 hours). + // Can be one of: day, week, month, quarter, year + TimePeriod string `url:"time_period,omitempty"` + + // The activity type to filter by. + // For example, you can choose to filter by "force_push", to see all force pushes to the repository. + // Can be one of: push, force_push, branch_creation, branch_deletion, pr_merge, merge_queue_merge + ActivityType string `url:"activity_type,omitempty"` +} + +// RepositoryActor represents a repository actor. +type RepositoryActor struct { + Login *string `json:"login,omitempty"` + ID *int64 `json:"id,omitempty"` + NodeID *string `json:"node_id,omitempty"` + AvatarURL *string `json:"avatar_url,omitempty"` + GravatarID *string `json:"gravatar_id,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + FollowersURL *string `json:"followers_url,omitempty"` + FollowingURL *string `json:"following_url,omitempty"` + GistsURL *string `json:"gists_url,omitempty"` + StarredURL *string `json:"starred_url,omitempty"` + SubscriptionsURL *string `json:"subscriptions_url,omitempty"` + OrganizationsURL *string `json:"organizations_url,omitempty"` + ReposURL *string `json:"repos_url,omitempty"` + EventsURL *string `json:"events_url,omitempty"` + ReceivedEventsURL *string `json:"received_events_url,omitempty"` + Type *string `json:"type,omitempty"` + UserViewType *string `json:"user_view_type,omitempty"` + SiteAdmin *bool `json:"site_admin,omitempty"` +} + +// RepositoryActivity represents a repository activity. +type RepositoryActivity struct { + ID int64 `json:"id"` + NodeID string `json:"node_id"` + Before string `json:"before"` + After string `json:"after"` + Ref string `json:"ref"` + Timestamp *Timestamp `json:"timestamp"` + ActivityType string `json:"activity_type"` + Actor *RepositoryActor `json:"actor,omitempty"` +} + +// ListRepositoryActivities lists the activities for a repository. +// +// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-activities +// +//meta:operation GET /repos/{owner}/{repo}/activity +func (s *RepositoriesService) ListRepositoryActivities(ctx context.Context, owner, repo string, opts *ListRepositoryActivityOptions) ([]*RepositoryActivity, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/activity", owner, repo) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var activities []*RepositoryActivity + resp, err := s.client.Do(ctx, req, &activities) + if err != nil { + return nil, resp, err + } + + return activities, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/repos_actions_access.go b/vendor/github.com/google/go-github/v75/github/repos_actions_access.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_actions_access.go rename to vendor/github.com/google/go-github/v75/github/repos_actions_access.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_actions_allowed.go b/vendor/github.com/google/go-github/v75/github/repos_actions_allowed.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_actions_allowed.go rename to vendor/github.com/google/go-github/v75/github/repos_actions_allowed.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_actions_permissions.go b/vendor/github.com/google/go-github/v75/github/repos_actions_permissions.go similarity index 58% rename from vendor/github.com/google/go-github/v69/github/repos_actions_permissions.go rename to vendor/github.com/google/go-github/v75/github/repos_actions_permissions.go index 9abd32a78..902c818a4 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_actions_permissions.go +++ b/vendor/github.com/google/go-github/v75/github/repos_actions_permissions.go @@ -116,3 +116,77 @@ func (s *RepositoriesService) EditDefaultWorkflowPermissions(ctx context.Context return p, resp, nil } + +// GetArtifactAndLogRetentionPeriod gets the artifact and log retention period for a repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention +func (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string) (*ArtifactPeriod, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/artifact-and-log-retention", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + arp := new(ArtifactPeriod) + resp, err := s.client.Do(ctx, req, arp) + if err != nil { + return nil, resp, err + } + + return arp, resp, nil +} + +// EditArtifactAndLogRetentionPeriod sets the artifact and log retention period for a repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention +func (s *RepositoriesService) EditArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string, period ArtifactPeriodOpt) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/artifact-and-log-retention", owner, repo) + req, err := s.client.NewRequest("PUT", u, period) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// GetPrivateRepoForkPRWorkflowSettings gets the settings for whether workflows from fork pull requests can run on a private repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-a-repository +// +//meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos +func (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string) (*WorkflowsPermissions, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos", owner, repo) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + permissions := new(WorkflowsPermissions) + resp, err := s.client.Do(ctx, req, permissions) + if err != nil { + return nil, resp, err + } + + return permissions, resp, nil +} + +// UpdatePrivateRepoForkPRWorkflowSettings sets the settings for whether workflows from fork pull requests can run on a private repository. +// +// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-a-repository +// +//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos +func (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string, permissions *WorkflowsPermissionsOpt) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos", owner, repo) + req, err := s.client.NewRequest("PUT", u, permissions) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} diff --git a/vendor/github.com/google/go-github/v69/github/repos_attestations.go b/vendor/github.com/google/go-github/v75/github/repos_attestations.go similarity index 92% rename from vendor/github.com/google/go-github/v69/github/repos_attestations.go rename to vendor/github.com/google/go-github/v75/github/repos_attestations.go index 2e5425502..c5f34cd4d 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_attestations.go +++ b/vendor/github.com/google/go-github/v75/github/repos_attestations.go @@ -17,7 +17,7 @@ import ( // //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 := fmt.Sprintf("repos/%v/%v/attestations/%v", owner, repo, subjectDigest) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/repos_autolinks.go b/vendor/github.com/google/go-github/v75/github/repos_autolinks.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_autolinks.go rename to vendor/github.com/google/go-github/v75/github/repos_autolinks.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_codeowners.go b/vendor/github.com/google/go-github/v75/github/repos_codeowners.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_codeowners.go rename to vendor/github.com/google/go-github/v75/github/repos_codeowners.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_collaborators.go b/vendor/github.com/google/go-github/v75/github/repos_collaborators.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_collaborators.go rename to vendor/github.com/google/go-github/v75/github/repos_collaborators.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_comments.go b/vendor/github.com/google/go-github/v75/github/repos_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_comments.go rename to vendor/github.com/google/go-github/v75/github/repos_comments.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_commits.go b/vendor/github.com/google/go-github/v75/github/repos_commits.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/repos_commits.go rename to vendor/github.com/google/go-github/v75/github/repos_commits.go index cca7430cb..48c87007e 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_commits.go +++ b/vendor/github.com/google/go-github/v75/github/repos_commits.go @@ -179,7 +179,7 @@ func (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha st // GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit // //meta:operation GET /repos/{owner}/{repo}/commits/{ref} -func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opts RawOptions) (string, *Response, error) { +func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha string, opts RawOptions) (string, *Response, error) { u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha) req, err := s.client.NewRequest("GET", u, nil) if err != nil { @@ -237,7 +237,7 @@ func (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, re // GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits // //meta:operation GET /repos/{owner}/{repo}/compare/{basehead} -func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { +func (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) { escapedBase := url.QueryEscape(base) escapedHead := url.QueryEscape(head) diff --git a/vendor/github.com/google/go-github/v69/github/repos_community_health.go b/vendor/github.com/google/go-github/v75/github/repos_community_health.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_community_health.go rename to vendor/github.com/google/go-github/v75/github/repos_community_health.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_contents.go b/vendor/github.com/google/go-github/v75/github/repos_contents.go similarity index 94% rename from vendor/github.com/google/go-github/v69/github/repos_contents.go rename to vendor/github.com/google/go-github/v75/github/repos_contents.go index 013993e5b..3b24b6d4e 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_contents.go +++ b/vendor/github.com/google/go-github/v75/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. E.g., `6540c41b`, `heads/main`, `tags/v1.0`. type RepositoryContentGetOptions struct { Ref string `url:"ref,omitempty"` } @@ -139,17 +139,24 @@ func (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) + fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) + if err == nil && fileContent != nil { + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), resp, nil + } + } + _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) if err != nil { return nil, resp, err } for _, contents := range dirContents { - if *contents.Name == filename { - if contents.DownloadURL == nil || *contents.DownloadURL == "" { + if contents.GetName() == filename { + if contents.GetDownloadURL() == "" { return nil, resp, fmt.Errorf("no download link found for %s", filepath) } - dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) if err != nil { return nil, resp, err @@ -181,17 +188,24 @@ func (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, func (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) { dir := path.Dir(filepath) filename := path.Base(filepath) + fileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts) + if err == nil && fileContent != nil { + content, err := fileContent.GetContent() + if err == nil && content != "" { + return io.NopCloser(strings.NewReader(content)), fileContent, resp, nil + } + } + _, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts) if err != nil { return nil, nil, resp, err } for _, contents := range dirContents { - if *contents.Name == filename { - if contents.DownloadURL == nil || *contents.DownloadURL == "" { + if contents.GetName() == filename { + if contents.GetDownloadURL() == "" { return nil, contents, resp, fmt.Errorf("no download link found for %s", filepath) } - dlReq, err := http.NewRequestWithContext(ctx, http.MethodGet, *contents.DownloadURL, nil) if err != nil { return nil, contents, resp, err diff --git a/vendor/github.com/google/go-github/v69/github/repos_deployment_branch_policies.go b/vendor/github.com/google/go-github/v75/github/repos_deployment_branch_policies.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_deployment_branch_policies.go rename to vendor/github.com/google/go-github/v75/github/repos_deployment_branch_policies.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_deployment_protection_rules.go b/vendor/github.com/google/go-github/v75/github/repos_deployment_protection_rules.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_deployment_protection_rules.go rename to vendor/github.com/google/go-github/v75/github/repos_deployment_protection_rules.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_deployments.go b/vendor/github.com/google/go-github/v75/github/repos_deployments.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/repos_deployments.go rename to vendor/github.com/google/go-github/v75/github/repos_deployments.go index 6277ac215..ae9978307 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/v75/github/repos_deployments.go @@ -32,15 +32,15 @@ type Deployment struct { // DeploymentRequest represents a deployment request. type DeploymentRequest struct { - Ref *string `json:"ref,omitempty"` - Task *string `json:"task,omitempty"` - AutoMerge *bool `json:"auto_merge,omitempty"` - RequiredContexts *[]string `json:"required_contexts,omitempty"` - Payload interface{} `json:"payload,omitempty"` - Environment *string `json:"environment,omitempty"` - Description *string `json:"description,omitempty"` - TransientEnvironment *bool `json:"transient_environment,omitempty"` - ProductionEnvironment *bool `json:"production_environment,omitempty"` + Ref *string `json:"ref,omitempty"` + Task *string `json:"task,omitempty"` + AutoMerge *bool `json:"auto_merge,omitempty"` + RequiredContexts *[]string `json:"required_contexts,omitempty"` + Payload any `json:"payload,omitempty"` + Environment *string `json:"environment,omitempty"` + Description *string `json:"description,omitempty"` + TransientEnvironment *bool `json:"transient_environment,omitempty"` + ProductionEnvironment *bool `json:"production_environment,omitempty"` } // DeploymentsListOptions specifies the optional parameters to the @@ -49,7 +49,7 @@ type DeploymentsListOptions struct { // SHA of the Deployment. SHA string `url:"sha,omitempty"` - // List deployments for a given ref. + // List deployments for a given ref. This can be a branch, tag, or SHA. Ref string `url:"ref,omitempty"` // List deployments for a given task. diff --git a/vendor/github.com/google/go-github/v69/github/repos_environments.go b/vendor/github.com/google/go-github/v75/github/repos_environments.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/repos_environments.go rename to vendor/github.com/google/go-github/v75/github/repos_environments.go index d3e34fa8f..eab51a11b 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_environments.go +++ b/vendor/github.com/google/go-github/v75/github/repos_environments.go @@ -62,8 +62,8 @@ type ProtectionRule struct { // RequiredReviewer represents a required reviewer. type RequiredReviewer struct { - Type *string `json:"type,omitempty"` - Reviewer interface{} `json:"reviewer,omitempty"` + Type *string `json:"type,omitempty"` + Reviewer any `json:"reviewer,omitempty"` } // EnvironmentListOptions specifies the optional parameters to the diff --git a/vendor/github.com/google/go-github/v69/github/repos_forks.go b/vendor/github.com/google/go-github/v75/github/repos_forks.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_forks.go rename to vendor/github.com/google/go-github/v75/github/repos_forks.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_hooks.go b/vendor/github.com/google/go-github/v75/github/repos_hooks.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/repos_hooks.go rename to vendor/github.com/google/go-github/v75/github/repos_hooks.go index d221db21b..862dd8b0e 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/v75/github/repos_hooks.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" "net/http" "net/url" @@ -39,15 +40,15 @@ type WebHookAuthor = CommitAuthor // Hook represents a GitHub (web and service) hook for a repository. type Hook struct { - CreatedAt *Timestamp `json:"created_at,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - URL *string `json:"url,omitempty"` - ID *int64 `json:"id,omitempty"` - Type *string `json:"type,omitempty"` - Name *string `json:"name,omitempty"` - TestURL *string `json:"test_url,omitempty"` - PingURL *string `json:"ping_url,omitempty"` - LastResponse map[string]interface{} `json:"last_response,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + URL *string `json:"url,omitempty"` + ID *int64 `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + Name *string `json:"name,omitempty"` + TestURL *string `json:"test_url,omitempty"` + PingURL *string `json:"ping_url,omitempty"` + LastResponse map[string]any `json:"last_response,omitempty"` // Only the following fields are used when creating a hook. // Config is required. @@ -83,6 +84,10 @@ type createHookRequest struct { // //meta:operation POST /repos/{owner}/{repo}/hooks func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { + if hook == nil { + return nil, nil, errors.New("hook must be provided") + } + u := fmt.Sprintf("repos/%v/%v/hooks", owner, repo) hookReq := &createHookRequest{ diff --git a/vendor/github.com/google/go-github/v69/github/repos_hooks_configuration.go b/vendor/github.com/google/go-github/v75/github/repos_hooks_configuration.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_hooks_configuration.go rename to vendor/github.com/google/go-github/v75/github/repos_hooks_configuration.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_hooks_deliveries.go b/vendor/github.com/google/go-github/v75/github/repos_hooks_deliveries.go similarity index 88% rename from vendor/github.com/google/go-github/v69/github/repos_hooks_deliveries.go rename to vendor/github.com/google/go-github/v75/github/repos_hooks_deliveries.go index c8029f626..526d82c6f 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_hooks_deliveries.go +++ b/vendor/github.com/google/go-github/v75/github/repos_hooks_deliveries.go @@ -9,6 +9,7 @@ import ( "context" "encoding/json" "fmt" + "strings" ) // HookDelivery represents the data that is received from GitHub's Webhook Delivery API @@ -39,6 +40,16 @@ func (d HookDelivery) String() string { return Stringify(d) } +// getHeader common function for GetHeader funcs of HookRequest & HookResponse. +func getHeader(headers map[string]string, key string) string { + for k, v := range headers { + if strings.EqualFold(k, key) { + return v + } + } + return "" +} + // HookRequest is a part of HookDelivery that contains // the HTTP headers and the JSON payload of the webhook request. type HookRequest struct { @@ -46,6 +57,11 @@ type HookRequest struct { RawPayload *json.RawMessage `json:"payload,omitempty"` } +// GetHeader gets the value associated with the given key (ignoring key case). +func (r *HookRequest) GetHeader(key string) string { + return getHeader(r.Headers, key) +} + func (r HookRequest) String() string { return Stringify(r) } @@ -57,6 +73,11 @@ type HookResponse struct { RawPayload *json.RawMessage `json:"payload,omitempty"` } +// GetHeader gets the value associated with the given key (ignoring key case). +func (r *HookResponse) GetHeader(key string) string { + return getHeader(r.Headers, key) +} + func (r HookResponse) String() string { return Stringify(r) } @@ -131,7 +152,7 @@ func (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, // ParseRequestPayload parses the request payload. For recognized event types, // a value of the corresponding struct type will be returned. -func (d *HookDelivery) ParseRequestPayload() (interface{}, error) { +func (d *HookDelivery) ParseRequestPayload() (any, error) { eType, ok := messageToTypeName[d.GetEvent()] if !ok { return nil, fmt.Errorf("unsupported event type %q", d.GetEvent()) diff --git a/vendor/github.com/google/go-github/v69/github/repos_invitations.go b/vendor/github.com/google/go-github/v75/github/repos_invitations.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_invitations.go rename to vendor/github.com/google/go-github/v75/github/repos_invitations.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_keys.go b/vendor/github.com/google/go-github/v75/github/repos_keys.go similarity index 88% rename from vendor/github.com/google/go-github/v69/github/repos_keys.go rename to vendor/github.com/google/go-github/v75/github/repos_keys.go index cc86f8bbd..0d050c803 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_keys.go +++ b/vendor/github.com/google/go-github/v75/github/repos_keys.go @@ -17,7 +17,7 @@ import ( // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys // //meta:operation GET /repos/{owner}/{repo}/keys -func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo string, opts *ListOptions) ([]*Key, *Response, error) { +func (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) u, err := addOptions(u, opts) if err != nil { @@ -43,7 +43,7 @@ func (s *RepositoriesService) ListKeys(ctx context.Context, owner string, repo s // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key // //meta:operation GET /repos/{owner}/{repo}/keys/{key_id} -func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo string, id int64) (*Key, *Response, error) { +func (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id int64) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) req, err := s.client.NewRequest("GET", u, nil) @@ -65,7 +65,7 @@ func (s *RepositoriesService) GetKey(ctx context.Context, owner string, repo str // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key // //meta:operation POST /repos/{owner}/{repo}/keys -func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo string, key *Key) (*Key, *Response, error) { +func (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, key *Key) (*Key, *Response, error) { u := fmt.Sprintf("repos/%v/%v/keys", owner, repo) req, err := s.client.NewRequest("POST", u, key) @@ -87,7 +87,7 @@ func (s *RepositoriesService) CreateKey(ctx context.Context, owner string, repo // GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key // //meta:operation DELETE /repos/{owner}/{repo}/keys/{key_id} -func (s *RepositoriesService) DeleteKey(ctx context.Context, owner string, repo string, id int64) (*Response, error) { +func (s *RepositoriesService) DeleteKey(ctx context.Context, owner, repo string, id int64) (*Response, error) { u := fmt.Sprintf("repos/%v/%v/keys/%v", owner, repo, id) req, err := s.client.NewRequest("DELETE", u, nil) diff --git a/vendor/github.com/google/go-github/v69/github/repos_lfs.go b/vendor/github.com/google/go-github/v75/github/repos_lfs.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_lfs.go rename to vendor/github.com/google/go-github/v75/github/repos_lfs.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_merging.go b/vendor/github.com/google/go-github/v75/github/repos_merging.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_merging.go rename to vendor/github.com/google/go-github/v75/github/repos_merging.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_pages.go b/vendor/github.com/google/go-github/v75/github/repos_pages.go similarity index 90% rename from vendor/github.com/google/go-github/v69/github/repos_pages.go rename to vendor/github.com/google/go-github/v75/github/repos_pages.go index 6b9ba76e4..5986fc01b 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_pages.go +++ b/vendor/github.com/google/go-github/v75/github/repos_pages.go @@ -7,6 +7,7 @@ package github import ( "context" + "errors" "fmt" ) @@ -107,6 +108,10 @@ type createPagesRequest struct { // //meta:operation POST /repos/{owner}/{repo}/pages func (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) { + if pages == nil { + return nil, nil, errors.New("pages must be provided") + } + u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) pagesReq := &createPagesRequest{ @@ -170,7 +175,35 @@ func (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo strin if err != nil { return resp, err } + return resp, nil +} + +// PagesUpdateWithoutCNAME defines parameters for updating a GitHub Pages site on GitHub Enterprise Servers. +// Sending a request with a CNAME (any value, empty string, or null) results in a 400 error: "Custom domains are not available for GitHub Pages". +type PagesUpdateWithoutCNAME struct { + BuildType *string `json:"build_type,omitempty"` + Source *PagesSource `json:"source,omitempty"` + Public *bool `json:"public,omitempty"` + HTTPSEnforced *bool `json:"https_enforced,omitempty"` +} +// UpdatePagesGHES updates GitHub Pages for the named repo in GitHub Enterprise Servers. +// +// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site +// +//meta:operation PUT /repos/{owner}/{repo}/pages +func (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo string, opts *PagesUpdateWithoutCNAME) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/pages", owner, repo) + + req, err := s.client.NewRequest("PUT", u, opts) + 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/v69/github/repos_prereceive_hooks.go b/vendor/github.com/google/go-github/v75/github/repos_prereceive_hooks.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/repos_prereceive_hooks.go rename to vendor/github.com/google/go-github/v75/github/repos_prereceive_hooks.go index e97075d02..144d2ec33 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_prereceive_hooks.go +++ b/vendor/github.com/google/go-github/v75/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.15/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/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.17/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.15/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.17/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.15/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.17/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/v69/github/repos_properties.go b/vendor/github.com/google/go-github/v75/github/repos_properties.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_properties.go rename to vendor/github.com/google/go-github/v75/github/repos_properties.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_releases.go b/vendor/github.com/google/go-github/v75/github/repos_releases.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/repos_releases.go rename to vendor/github.com/google/go-github/v75/github/repos_releases.go index 6023f6327..87056071c 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_releases.go +++ b/vendor/github.com/google/go-github/v75/github/repos_releases.go @@ -79,6 +79,7 @@ type ReleaseAsset struct { BrowserDownloadURL *string `json:"browser_download_url,omitempty"` Uploader *User `json:"uploader,omitempty"` NodeID *string `json:"node_id,omitempty"` + Digest *string `json:"digest,omitempty"` } func (r ReleaseAsset) String() string { @@ -202,6 +203,10 @@ type repositoryReleaseRequest struct { // //meta:operation POST /repos/{owner}/{repo}/releases func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { + if release == nil { + return nil, nil, errors.New("release must be provided") + } + u := fmt.Sprintf("repos/%s/%s/releases", owner, repo) releaseReq := &repositoryReleaseRequest{ @@ -238,6 +243,10 @@ func (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo str // //meta:operation PATCH /repos/{owner}/{repo}/releases/{release_id} func (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) { + if release == nil { + return nil, nil, errors.New("release must be provided") + } + u := fmt.Sprintf("repos/%s/%s/releases/%d", owner, repo, id) releaseReq := &repositoryReleaseRequest{ @@ -355,7 +364,7 @@ func (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, r var loc string saveRedirect := s.client.client.CheckRedirect - s.client.client.CheckRedirect = func(req *http.Request, via []*http.Request) error { + s.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error { loc = req.URL.String() return errors.New("disable redirect") } @@ -443,6 +452,10 @@ func (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, rep // //meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) { + if file == nil { + return nil, nil, errors.New("file must be provided") + } + u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/repos_rules.go b/vendor/github.com/google/go-github/v75/github/repos_rules.go similarity index 88% rename from vendor/github.com/google/go-github/v69/github/repos_rules.go rename to vendor/github.com/google/go-github/v75/github/repos_rules.go index d38e35cdd..038cefd71 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_rules.go +++ b/vendor/github.com/google/go-github/v75/github/repos_rules.go @@ -38,9 +38,14 @@ type rulesetClearBypassActors struct { // 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) (*BranchRules, *Response, error) { +func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) { u := fmt.Sprintf("repos/%v/%v/rules/branches/%v", owner, repo, branch) + 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 @@ -55,14 +60,28 @@ func (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo return rules, resp, nil } +// RepositoryListRulesetsOptions specifies optional parameters to the +// RepositoriesService.GetAllRulesets method. +type RepositoryListRulesetsOptions struct { + // IncludesParents indicates whether to include rulesets configured at the organization or enterprise level that apply to the repository. + IncludesParents *bool `url:"includes_parents,omitempty"` + ListOptions +} + // GetAllRulesets gets all the repository rulesets for the specified repository. -// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned. +// By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository. +// To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`. // // 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) ([]*RepositoryRuleset, *Response, error) { - u := fmt.Sprintf("repos/%v/%v/rulesets?includes_parents=%v", owner, repo, includesParents) +func (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/rulesets", owner, repo) + + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/repos_stats.go b/vendor/github.com/google/go-github/v75/github/repos_stats.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_stats.go rename to vendor/github.com/google/go-github/v75/github/repos_stats.go diff --git a/vendor/github.com/google/go-github/v69/github/repos_statuses.go b/vendor/github.com/google/go-github/v75/github/repos_statuses.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/repos_statuses.go rename to vendor/github.com/google/go-github/v75/github/repos_statuses.go index e7b030475..21f2c4c1e 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/v75/github/repos_statuses.go @@ -43,7 +43,7 @@ func (r RepoStatus) String() string { } // ListStatuses lists the statuses of a repository at the specified -// reference. ref can be a SHA, a branch name, or a tag name. +// reference. The ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference // @@ -70,7 +70,7 @@ func (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref } // CreateStatus creates a new status for a repository at the specified -// reference. Ref can be a SHA, a branch name, or a tag name. +// reference. The ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status // @@ -111,7 +111,7 @@ func (s CombinedStatus) String() string { } // GetCombinedStatus returns the combined status of a repository at the specified -// reference. ref can be a SHA, a branch name, or a tag name. +// reference. The ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference // diff --git a/vendor/github.com/google/go-github/v69/github/repos_tags.go b/vendor/github.com/google/go-github/v75/github/repos_tags.go similarity index 73% rename from vendor/github.com/google/go-github/v69/github/repos_tags.go rename to vendor/github.com/google/go-github/v75/github/repos_tags.go index b6dc36e2a..9c789cc82 100644 --- a/vendor/github.com/google/go-github/v69/github/repos_tags.go +++ b/vendor/github.com/google/go-github/v75/github/repos_tags.go @@ -22,8 +22,9 @@ type tagProtectionRequest struct { Pattern string `json:"pattern"` } -// 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 +// ListTagProtection lists tag protection of the specified repository. +// +// Deprecated: 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#closing-down---list-tag-protection-states-for-a-repository // @@ -45,8 +46,9 @@ func (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo return tagProtections, resp, nil } -// 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 +// CreateTagProtection creates the tag protection of the specified repository. +// +// Deprecated: 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#closing-down---create-a-tag-protection-state-for-a-repository // @@ -68,8 +70,9 @@ func (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, re return tagProtection, resp, nil } -// 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 +// DeleteTagProtection deletes a tag protection from the specified repository. +// +// Deprecated: 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#closing-down---delete-a-tag-protection-state-for-a-repository // diff --git a/vendor/github.com/google/go-github/v69/github/repos_traffic.go b/vendor/github.com/google/go-github/v75/github/repos_traffic.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/repos_traffic.go rename to vendor/github.com/google/go-github/v75/github/repos_traffic.go diff --git a/vendor/github.com/google/go-github/v69/github/rules.go b/vendor/github.com/google/go-github/v75/github/rules.go similarity index 95% rename from vendor/github.com/google/go-github/v69/github/rules.go rename to vendor/github.com/google/go-github/v75/github/rules.go index 8312d9523..7b474f00e 100644 --- a/vendor/github.com/google/go-github/v69/github/rules.go +++ b/vendor/github.com/google/go-github/v75/github/rules.go @@ -58,8 +58,9 @@ type BypassMode string // This is the set of GitHub ruleset bypass modes. const ( BypassModeAlways BypassMode = "always" - BypassModePullRequest BypassMode = "pull_request" + BypassModeExempt BypassMode = "exempt" BypassModeNever BypassMode = "never" + BypassModePullRequest BypassMode = "pull_request" ) // RepositoryRuleType represents a GitHub ruleset rule type. @@ -99,14 +100,34 @@ const ( MergeGroupingStrategyHeadGreen MergeGroupingStrategy = "HEADGREEN" ) -// MergeMethod models a GitHub merge method. -type MergeMethod string +// PullRequestMergeMethod is used in PullRequestRuleParameters, +// where the GitHub API expects lowercase merge method values: "merge", "rebase", "squash". +// +// NOTE: GitHub's API inconsistently uses different casing for the same logical values +// across different rules. +// +// TODO: Unify with MergeQueueMergeMethod once the GitHub API uses consistent casing. +type PullRequestMergeMethod string + +const ( + PullRequestMergeMethodMerge PullRequestMergeMethod = "merge" + PullRequestMergeMethodRebase PullRequestMergeMethod = "rebase" + PullRequestMergeMethodSquash PullRequestMergeMethod = "squash" +) + +// MergeQueueMergeMethod is used in MergeQueueRuleParameters, +// where the GitHub API expects uppercase merge method values: "MERGE", "REBASE", "SQUASH". +// +// NOTE: This type exists alongside PullRequestMergeMethod solely due to API casing inconsistencies. +// It enforces the correct usage by API context. +// +// TODO: Unify with PullRequestMergeMethod once the GitHub API uses consistent casing. +type MergeQueueMergeMethod string -// This is the set of GitHub merge methods. const ( - MergeMethodMerge MergeMethod = "merge" - MergeMethodRebase MergeMethod = "rebase" - MergeMethodSquash MergeMethod = "squash" + MergeQueueMergeMethodMerge MergeQueueMergeMethod = "MERGE" + MergeQueueMergeMethodRebase MergeQueueMergeMethod = "REBASE" + MergeQueueMergeMethodSquash MergeQueueMergeMethod = "SQUASH" ) // PatternRuleOperator models a GitHub pattern rule operator. @@ -383,7 +404,7 @@ type MergeQueueRuleParameters struct { GroupingStrategy MergeGroupingStrategy `json:"grouping_strategy"` MaxEntriesToBuild int `json:"max_entries_to_build"` MaxEntriesToMerge int `json:"max_entries_to_merge"` - MergeMethod MergeMethod `json:"merge_method"` + MergeMethod MergeQueueMergeMethod `json:"merge_method"` MinEntriesToMerge int `json:"min_entries_to_merge"` MinEntriesToMergeWaitMinutes int `json:"min_entries_to_merge_wait_minutes"` } @@ -395,12 +416,13 @@ type RequiredDeploymentsRuleParameters struct { // PullRequestRuleParameters represents the pull_request rule parameters. type PullRequestRuleParameters struct { - AllowedMergeMethods []MergeMethod `json:"allowed_merge_methods"` - 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"` + AllowedMergeMethods []PullRequestMergeMethod `json:"allowed_merge_methods"` + AutomaticCopilotCodeReviewEnabled *bool `json:"automatic_copilot_code_review_enabled,omitempty"` + 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"` } // RequiredStatusChecksRuleParameters represents the required status checks rule parameters. diff --git a/vendor/github.com/google/go-github/v69/github/scim.go b/vendor/github.com/google/go-github/v75/github/scim.go similarity index 89% rename from vendor/github.com/google/go-github/v69/github/scim.go rename to vendor/github.com/google/go-github/v75/github/scim.go index 70f063caa..8b3c1c4ee 100644 --- a/vendor/github.com/google/go-github/v69/github/scim.go +++ b/vendor/github.com/google/go-github/v75/github/scim.go @@ -108,6 +108,26 @@ type ListSCIMProvisionedIdentitiesOptions struct { Filter *string `url:"filter,omitempty"` } +// ListSCIMProvisionedGroupsForEnterpriseOptions represents options for ListSCIMProvisionedGroupsForEnterprise. +// +// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise--parameters +type ListSCIMProvisionedGroupsForEnterpriseOptions struct { + // Filter specifies the matching results to return. + // Multiple filters are not supported. Possible filters are externalId, id, and displayName. + // For example: ?filter=externalId eq "9138790-10932-109120392-12321". + // (Optional.) + Filter *string `url:"filter,omitempty"` + // ExcludedAttributes excludes the specified attribute from being returned in the results. + // Using this parameter can speed up response time. (Optional.) + ExcludedAttributes *string `url:"excludedAttributes,omitempty"` + // StartIndex used for pagination: the starting index of the first result to return when paginating through values. (Optional.) + // Default: 1. + StartIndex *int `url:"startIndex,omitempty"` + // Count used for pagination: the number of results to return per page. (Optional.) + // Default: 30. + Count *int `url:"count,omitempty"` +} + // ListSCIMProvisionedIdentities lists SCIM provisioned identities. // // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities @@ -252,8 +272,12 @@ func (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID // GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise // //meta:operation GET /scim/v2/enterprises/{enterprise}/Groups -func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedGroups, *Response, error) { +func (s *SCIMService) ListSCIMProvisionedGroupsForEnterprise(ctx context.Context, enterprise string, opts *ListSCIMProvisionedGroupsForEnterpriseOptions) (*SCIMProvisionedGroups, *Response, error) { u := fmt.Sprintf("scim/v2/enterprises/%v/Groups", enterprise) + u, err := addOptions(u, opts) + if err != nil { + return nil, nil, err + } req, err := s.client.NewRequest("GET", u, nil) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/search.go b/vendor/github.com/google/go-github/v75/github/search.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/search.go rename to vendor/github.com/google/go-github/v75/github/search.go index 54bc6d5e1..a8d8a62cd 100644 --- a/vendor/github.com/google/go-github/v69/github/search.go +++ b/vendor/github.com/google/go-github/v75/github/search.go @@ -92,6 +92,7 @@ type TopicsSearchResult struct { Topics []*TopicResult `json:"items,omitempty"` } +// TopicResult represents a topic search result. type TopicResult struct { Name *string `json:"name,omitempty"` DisplayName *string `json:"display_name,omitempty"` @@ -300,7 +301,7 @@ func (s *SearchService) Labels(ctx context.Context, repoID int64, query string, // // If searchParameters.Query includes multiple condition, it MUST NOT include "+" as condition separator. // For example, querying with "language:c++" and "leveldb", then searchParameters.Query should be "language:c++ leveldb" but not "language:c+++leveldb". -func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result interface{}) (*Response, error) { +func (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result any) (*Response, error) { params, err := qs.Values(opts) if err != nil { return nil, err @@ -317,20 +318,20 @@ func (s *SearchService) search(ctx context.Context, searchType string, parameter return nil, err } var acceptHeaders []string - switch { - case searchType == "commits": + switch searchType { + case "commits": // Accept header for search commits preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview) - case searchType == "topics": + case "topics": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case searchType == "repositories": + case "repositories": // Accept header for search repositories based on topics preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview) - case searchType == "issues": + case "issues": // Accept header for search issues based on reactions preview endpoint // TODO: remove custom Accept header when this API fully launches. acceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview) diff --git a/vendor/github.com/google/go-github/v69/github/secret_scanning.go b/vendor/github.com/google/go-github/v75/github/secret_scanning.go similarity index 72% rename from vendor/github.com/google/go-github/v69/github/secret_scanning.go rename to vendor/github.com/google/go-github/v75/github/secret_scanning.go index 35322cf66..f75800f6e 100644 --- a/vendor/github.com/google/go-github/v69/github/secret_scanning.go +++ b/vendor/github.com/google/go-github/v75/github/secret_scanning.go @@ -16,24 +16,34 @@ type SecretScanningService service // SecretScanningAlert represents a GitHub secret scanning alert. type SecretScanningAlert struct { - Number *int `json:"number,omitempty"` - CreatedAt *Timestamp `json:"created_at,omitempty"` - URL *string `json:"url,omitempty"` - HTMLURL *string `json:"html_url,omitempty"` - LocationsURL *string `json:"locations_url,omitempty"` - State *string `json:"state,omitempty"` - Resolution *string `json:"resolution,omitempty"` - ResolvedAt *Timestamp `json:"resolved_at,omitempty"` - ResolvedBy *User `json:"resolved_by,omitempty"` - SecretType *string `json:"secret_type,omitempty"` - SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` - Secret *string `json:"secret,omitempty"` - Repository *Repository `json:"repository,omitempty"` - UpdatedAt *Timestamp `json:"updated_at,omitempty"` - PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` - PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` - PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` - ResolutionComment *string `json:"resolution_comment,omitempty"` + Number *int `json:"number,omitempty"` + CreatedAt *Timestamp `json:"created_at,omitempty"` + URL *string `json:"url,omitempty"` + HTMLURL *string `json:"html_url,omitempty"` + LocationsURL *string `json:"locations_url,omitempty"` + FirstLocationDetected *SecretScanningAlertLocationDetails `json:"first_location_detected,omitempty"` + HasMoreLocations *bool `json:"has_more_locations,omitempty"` + State *string `json:"state,omitempty"` + Resolution *string `json:"resolution,omitempty"` + ResolvedAt *Timestamp `json:"resolved_at,omitempty"` + ResolvedBy *User `json:"resolved_by,omitempty"` + SecretType *string `json:"secret_type,omitempty"` + SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"` + Secret *string `json:"secret,omitempty"` + Repository *Repository `json:"repository,omitempty"` + UpdatedAt *Timestamp `json:"updated_at,omitempty"` + IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"` + MultiRepo *bool `json:"multi_repo,omitempty"` + PubliclyLeaked *bool `json:"publicly_leaked,omitempty"` + PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"` + PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"` + PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"` + ResolutionComment *string `json:"resolution_comment,omitempty"` + PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"` + PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"` + PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"` + PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"` + Validity *string `json:"validity,omitempty"` } // SecretScanningAlertLocation represents the location for a secret scanning alert. @@ -68,6 +78,16 @@ type SecretScanningAlertListOptions struct { // Valid resolutions are false_positive, wont_fix, revoked, pattern_edited, pattern_deleted or used_in_tests. Resolution string `url:"resolution,omitempty"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. + // Valid options are active, inactive, and unknown. + Validity string `url:"validity,omitempty"` + + // A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false. + IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"` + + // A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false. + IsMultiRepo bool `url:"is_multi_repo,omitempty"` + // The direction to sort the results by. Possible values are: asc, desc. Default: desc. Direction string `url:"direction,omitempty"` diff --git a/vendor/github.com/google/go-github/v75/github/secret_scanning_pattern_configs.go b/vendor/github.com/google/go-github/v75/github/secret_scanning_pattern_configs.go new file mode 100644 index 000000000..c2d51f7d8 --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/secret_scanning_pattern_configs.go @@ -0,0 +1,165 @@ +// Copyright 2025 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" +) + +// SecretScanningPatternConfigs represents a collection of GitHub secret scanning patterns +// and their settings related to push protection. +type SecretScanningPatternConfigs struct { + PatternConfigVersion *string `json:"pattern_config_version,omitempty"` + ProviderPatternOverrides []*SecretScanningPatternOverride `json:"provider_pattern_overrides,omitempty"` + CustomPatternOverrides []*SecretScanningPatternOverride `json:"custom_pattern_overrides,omitempty"` +} + +// SecretScanningPatternOverride respresents an override for provider partner or custom organization patterns. +type SecretScanningPatternOverride struct { + TokenType *string `json:"token_type,omitempty"` + CustomPatternVersion *string `json:"custom_pattern_version,omitempty"` + Slug *string `json:"slug,omitempty"` + DisplayName *string `json:"display_name,omitempty"` + AlertTotal *int `json:"alert_total,omitempty"` + AlertTotalPercentage *int `json:"alert_total_percentage,omitempty"` + FalsePositives *int `json:"false_positives,omitempty"` + FalsePositiveRate *int `json:"false_positive_rate,omitempty"` + Bypassrate *int `json:"bypass_rate,omitempty"` + DefaultSetting *string `json:"default_setting,omitempty"` + EnterpriseSetting *string `json:"enterprise_setting,omitempty"` + Setting *string `json:"setting,omitempty"` +} + +// SecretScanningPatternConfigsUpdate represents a secret scanning pattern configurations update. +type SecretScanningPatternConfigsUpdate struct { + PatternConfigVersion *string `json:"pattern_config_version,omitempty"` +} + +// SecretScanningPatternConfigsUpdateOptions specifies optional parameters to +// the SecretScanningService.UpdatePatternConfigsForEnterprise method and +// the SecretScanningService.UpdatePatternConfigsForOrg method. +type SecretScanningPatternConfigsUpdateOptions struct { + // The version of the entity. + PatternConfigVersion *string `json:"pattern_config_version,omitempty"` + + // Pattern settings for provider patterns. + ProviderPatternSettings []*SecretScanningProviderPatternSetting `json:"provider_pattern_settings,omitempty"` + + // Pattern settings for custom patterns. + CustomPatternSettings []*SecretScanningCustomPatternSetting `json:"custom_pattern_settings,omitempty"` +} + +// SecretScanningProviderPatternSetting defines an optional pattern setting for provider patterns. +type SecretScanningProviderPatternSetting struct { + // The ID of the pattern to configure. + TokenType string `json:"token_type"` + + // Push protection setting to set for the pattern. + // Can be one of: "not-set", "disabled", "enabled" + PushProtectionSetting string `json:"push_protection_setting"` +} + +// SecretScanningCustomPatternSetting defines an optional pattern setting for custom patterns. +type SecretScanningCustomPatternSetting struct { + // The ID of the pattern to configure. + TokenType string `json:"token_type"` + + // The version of the entity + CustomPatternVersion *string `json:"custom_pattern_version,omitempty"` + + // Push protection setting to set for the pattern. + // Can be one of: "not-set", "disabled", "enabled" + PushProtectionSetting string `json:"push_protection_setting"` +} + +// ListPatternConfigsForEnterprise lists the secret scanning pattern configurations for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#list-enterprise-pattern-configurations +// +//meta:operation GET /enterprises/{enterprise}/secret-scanning/pattern-configurations +func (s *SecretScanningService) ListPatternConfigsForEnterprise(ctx context.Context, enterprise string) (*SecretScanningPatternConfigs, *Response, error) { + u := fmt.Sprintf("enterprises/%v/secret-scanning/pattern-configurations", enterprise) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var patternConfigs *SecretScanningPatternConfigs + resp, err := s.client.Do(ctx, req, &patternConfigs) + if err != nil { + return nil, resp, err + } + + return patternConfigs, resp, nil +} + +// ListPatternConfigsForOrg lists the secret scanning pattern configurations for an organization. +// +// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#list-organization-pattern-configurations +// +//meta:operation GET /orgs/{org}/secret-scanning/pattern-configurations +func (s *SecretScanningService) ListPatternConfigsForOrg(ctx context.Context, org string) (*SecretScanningPatternConfigs, *Response, error) { + u := fmt.Sprintf("orgs/%v/secret-scanning/pattern-configurations", org) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + var patternConfigs *SecretScanningPatternConfigs + resp, err := s.client.Do(ctx, req, &patternConfigs) + if err != nil { + return nil, resp, err + } + + return patternConfigs, resp, nil +} + +// UpdatePatternConfigsForEnterprise updates the secret scanning pattern configurations for an enterprise. +// +// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#update-enterprise-pattern-configurations +// +//meta:operation PATCH /enterprises/{enterprise}/secret-scanning/pattern-configurations +func (s *SecretScanningService) UpdatePatternConfigsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) { + u := fmt.Sprintf("enterprises/%v/secret-scanning/pattern-configurations", enterprise) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + var patternConfigsUpdate *SecretScanningPatternConfigsUpdate + resp, err := s.client.Do(ctx, req, &patternConfigsUpdate) + if err != nil { + return nil, resp, err + } + + return patternConfigsUpdate, resp, nil +} + +// UpdatePatternConfigsForOrg updates the secret scanning pattern configurations for an organization. +// +// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#update-organization-pattern-configurations +// +//meta:operation PATCH /orgs/{org}/secret-scanning/pattern-configurations +func (s *SecretScanningService) UpdatePatternConfigsForOrg(ctx context.Context, org string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) { + u := fmt.Sprintf("orgs/%v/secret-scanning/pattern-configurations", org) + + req, err := s.client.NewRequest("PATCH", u, opts) + if err != nil { + return nil, nil, err + } + + var patternConfigsUpdate *SecretScanningPatternConfigsUpdate + resp, err := s.client.Do(ctx, req, &patternConfigsUpdate) + if err != nil { + return nil, resp, err + } + + return patternConfigsUpdate, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/security_advisories.go b/vendor/github.com/google/go-github/v75/github/security_advisories.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/security_advisories.go rename to vendor/github.com/google/go-github/v75/github/security_advisories.go index b5a43f1aa..d783345de 100644 --- a/vendor/github.com/google/go-github/v69/github/security_advisories.go +++ b/vendor/github.com/google/go-github/v75/github/security_advisories.go @@ -11,6 +11,10 @@ import ( "fmt" ) +// SecurityAdvisoriesService handles communication with the security advisories +// related methods of the GitHub API. +// +// GitHub API docs: https://docs.github.com/rest/security-advisories type SecurityAdvisoriesService service // SecurityAdvisorySubmission represents the Security Advisory Submission. diff --git a/vendor/github.com/google/go-github/v69/github/strings.go b/vendor/github.com/google/go-github/v75/github/strings.go similarity index 97% rename from vendor/github.com/google/go-github/v69/github/strings.go rename to vendor/github.com/google/go-github/v75/github/strings.go index f5e61aa32..46fd55ad1 100644 --- a/vendor/github.com/google/go-github/v69/github/strings.go +++ b/vendor/github.com/google/go-github/v75/github/strings.go @@ -16,7 +16,7 @@ var timestampType = reflect.TypeOf(Timestamp{}) // Stringify attempts to create a reasonable string representation of types in // the GitHub library. It does things like resolve pointers to their values // and omits struct fields with nil values. -func Stringify(message interface{}) string { +func Stringify(message any) string { var buf bytes.Buffer v := reflect.ValueOf(message) stringifyValue(&buf, v) diff --git a/vendor/github.com/google/go-github/v75/github/sub_issue.go b/vendor/github.com/google/go-github/v75/github/sub_issue.go new file mode 100644 index 000000000..2effcc5af --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/sub_issue.go @@ -0,0 +1,140 @@ +// Copyright 2025 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" +) + +// SubIssueService handles communication with the sub-issue related +// methods of the GitHub API. +// +// Sub-issues help you group and manage your issues with a parent/child relationship. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues +type SubIssueService service + +// SubIssue represents a GitHub sub-issue on a repository. +// Note: As far as the GitHub API is concerned, every pull request is an issue, +// but not every issue is a pull request. Some endpoints, events, and webhooks +// may also return pull requests via this struct. If PullRequestLinks is nil, +// this is an issue, and if PullRequestLinks is not nil, this is a pull request. +// The IsPullRequest helper method can be used to check that. +type SubIssue Issue + +func (i SubIssue) String() string { + return Stringify(i) +} + +// SubIssueListByIssueOptions specifies the optional parameters to the +// SubIssueService.ListByIssue method. +type SubIssueListByIssueOptions struct { + IssueListByRepoOptions +} + +// SubIssueRequest represents a request to add, remove, or reprioritize sub-issues. +type SubIssueRequest struct { + SubIssueID int64 `json:"sub_issue_id"` // Required: The ID of the sub-issue + AfterID *int64 `json:"after_id,omitempty"` // Optional: Position after this sub-issue ID + BeforeID *int64 `json:"before_id,omitempty"` // Optional: Position before this sub-issue ID + ReplaceParent *bool `json:"replace_parent,omitempty"` // Optional: Whether to replace the existing parent +} + +// Remove a sub-issue from the specified repository. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue +// +//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue +func (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issue", owner, repo, issueNumber) + + req, err := s.client.NewRequest("DELETE", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} + +// ListByIssue lists all sub-issues for the specified issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues +// +//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues +func (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *IssueListOptions) ([]*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) + 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 subIssues []*SubIssue + resp, err := s.client.Do(ctx, req, &subIssues) + if err != nil { + return nil, resp, err + } + + return subIssues, resp, nil +} + +// Add adds a sub-issue to the specified issue. +// +// The sub-issue to be added must belong to the same repository owner as the parent issue. +// To replace the existing parent of a sub-issue, set replaceParent to true. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue +// +//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues +func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) + req, err := s.client.NewRequest("POST", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} + +// Reprioritize changes a sub-issue's priority to a different position in the parent list. +// +// Either afterId or beforeId must be specified to determine the new position of the sub-issue. +// +// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue +// +//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority +func (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues/priority", owner, repo, issueNumber) + req, err := s.client.NewRequest("PATCH", u, subIssue) + if err != nil { + return nil, nil, err + } + + si := new(SubIssue) + resp, err := s.client.Do(ctx, req, si) + if err != nil { + return nil, resp, err + } + + return si, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/teams.go b/vendor/github.com/google/go-github/v75/github/teams.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/teams.go rename to vendor/github.com/google/go-github/v75/github/teams.go diff --git a/vendor/github.com/google/go-github/v69/github/teams_discussion_comments.go b/vendor/github.com/google/go-github/v75/github/teams_discussion_comments.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/teams_discussion_comments.go rename to vendor/github.com/google/go-github/v75/github/teams_discussion_comments.go diff --git a/vendor/github.com/google/go-github/v69/github/teams_discussions.go b/vendor/github.com/google/go-github/v75/github/teams_discussions.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/teams_discussions.go rename to vendor/github.com/google/go-github/v75/github/teams_discussions.go diff --git a/vendor/github.com/google/go-github/v69/github/teams_members.go b/vendor/github.com/google/go-github/v75/github/teams_members.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/teams_members.go rename to vendor/github.com/google/go-github/v75/github/teams_members.go diff --git a/vendor/github.com/google/go-github/v69/github/timestamp.go b/vendor/github.com/google/go-github/v75/github/timestamp.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/timestamp.go rename to vendor/github.com/google/go-github/v75/github/timestamp.go diff --git a/vendor/github.com/google/go-github/v69/github/users.go b/vendor/github.com/google/go-github/v75/github/users.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users.go rename to vendor/github.com/google/go-github/v75/github/users.go diff --git a/vendor/github.com/google/go-github/v69/github/users_administration.go b/vendor/github.com/google/go-github/v75/github/users_administration.go similarity index 91% rename from vendor/github.com/google/go-github/v69/github/users_administration.go rename to vendor/github.com/google/go-github/v75/github/users_administration.go index c0aa3b649..5d0d4c15e 100644 --- a/vendor/github.com/google/go-github/v69/github/users_administration.go +++ b/vendor/github.com/google/go-github/v75/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.15/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#demote-a-site-administrator +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#suspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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.15/rest/enterprise-admin/users#unsuspend-a-user +// GitHub API docs: https://docs.github.com/enterprise-server@3.17/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/v69/github/users_attestations.go b/vendor/github.com/google/go-github/v75/github/users_attestations.go similarity index 93% rename from vendor/github.com/google/go-github/v69/github/users_attestations.go rename to vendor/github.com/google/go-github/v75/github/users_attestations.go index 18f60298d..d63634500 100644 --- a/vendor/github.com/google/go-github/v69/github/users_attestations.go +++ b/vendor/github.com/google/go-github/v75/github/users_attestations.go @@ -18,7 +18,7 @@ import ( // //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 := fmt.Sprintf("users/%v/attestations/%v", user, subjectDigest) u, err := addOptions(u, opts) if err != nil { diff --git a/vendor/github.com/google/go-github/v69/github/users_blocking.go b/vendor/github.com/google/go-github/v75/github/users_blocking.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users_blocking.go rename to vendor/github.com/google/go-github/v75/github/users_blocking.go diff --git a/vendor/github.com/google/go-github/v69/github/users_emails.go b/vendor/github.com/google/go-github/v75/github/users_emails.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users_emails.go rename to vendor/github.com/google/go-github/v75/github/users_emails.go diff --git a/vendor/github.com/google/go-github/v69/github/users_followers.go b/vendor/github.com/google/go-github/v75/github/users_followers.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users_followers.go rename to vendor/github.com/google/go-github/v75/github/users_followers.go diff --git a/vendor/github.com/google/go-github/v69/github/users_gpg_keys.go b/vendor/github.com/google/go-github/v75/github/users_gpg_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users_gpg_keys.go rename to vendor/github.com/google/go-github/v75/github/users_gpg_keys.go diff --git a/vendor/github.com/google/go-github/v69/github/users_keys.go b/vendor/github.com/google/go-github/v75/github/users_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users_keys.go rename to vendor/github.com/google/go-github/v75/github/users_keys.go diff --git a/vendor/github.com/google/go-github/v69/github/users_packages.go b/vendor/github.com/google/go-github/v75/github/users_packages.go similarity index 98% rename from vendor/github.com/google/go-github/v69/github/users_packages.go rename to vendor/github.com/google/go-github/v75/github/users_packages.go index 3ccf68a16..b813dd9d1 100644 --- a/vendor/github.com/google/go-github/v69/github/users_packages.go +++ b/vendor/github.com/google/go-github/v75/github/users_packages.go @@ -8,6 +8,7 @@ package github import ( "context" "fmt" + "net/url" ) // ListPackages lists the packages for a user. Passing the empty string for "user" will @@ -55,9 +56,9 @@ func (s *UsersService) ListPackages(ctx context.Context, user string, opts *Pack func (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) { var u string if user != "" { - u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, packageName) + u = fmt.Sprintf("users/%v/packages/%v/%v", user, packageType, url.PathEscape(packageName)) } else { - u = fmt.Sprintf("user/packages/%v/%v", packageType, packageName) + u = fmt.Sprintf("user/packages/%v/%v", packageType, url.PathEscape(packageName)) } req, err := s.client.NewRequest("GET", u, nil) diff --git a/vendor/github.com/google/go-github/v75/github/users_social_accounts.go b/vendor/github.com/google/go-github/v75/github/users_social_accounts.go new file mode 100644 index 000000000..30927cd8d --- /dev/null +++ b/vendor/github.com/google/go-github/v75/github/users_social_accounts.go @@ -0,0 +1,105 @@ +// Copyright 2025 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" +) + +// SocialAccount represents a social account linked to a user. +type SocialAccount struct { + Provider *string `json:"provider,omitempty"` + URL *string `json:"url,omitempty"` +} + +// ListSocialAccounts lists all social accounts for the authenticated user. +// +// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user +// +//meta:operation GET /user/social_accounts +func (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions) ([]*SocialAccount, *Response, error) { + u := "user/social_accounts" + 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 socialAccounts []*SocialAccount + resp, err := s.client.Do(ctx, req, &socialAccounts) + if err != nil { + return nil, resp, err + } + + return socialAccounts, resp, nil +} + +// AddSocialAccounts adds social accounts for the authenticated user. +// +// GitHub API docs: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user +// +//meta:operation POST /user/social_accounts +func (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []string) ([]*SocialAccount, *Response, error) { + u := "user/social_accounts" + req, err := s.client.NewRequest("POST", u, accountURLs) + if err != nil { + return nil, nil, err + } + + var accounts []*SocialAccount + resp, err := s.client.Do(ctx, req, &accounts) + if err != nil { + return nil, resp, err + } + + return accounts, resp, nil +} + +// DeleteSocialAccounts deletes social accounts for the authenticated user. +// +// GitHub API docs: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user +// +//meta:operation DELETE /user/social_accounts +func (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountURLs []string) (*Response, error) { + u := "user/social_accounts" + req, err := s.client.NewRequest("DELETE", u, accountURLs) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + +// ListUserSocialAccounts lists all social accounts for a user. +// +// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user +// +//meta:operation GET /users/{username}/social_accounts +func (s *UsersService) ListUserSocialAccounts(ctx context.Context, username string, opts *ListOptions) ([]*SocialAccount, *Response, error) { + u := fmt.Sprintf("users/%v/social_accounts", username) + 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 addedAccounts []*SocialAccount + resp, err := s.client.Do(ctx, req, &addedAccounts) + if err != nil { + return nil, resp, err + } + + return addedAccounts, resp, nil +} diff --git a/vendor/github.com/google/go-github/v69/github/users_ssh_signing_keys.go b/vendor/github.com/google/go-github/v75/github/users_ssh_signing_keys.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/users_ssh_signing_keys.go rename to vendor/github.com/google/go-github/v75/github/users_ssh_signing_keys.go diff --git a/vendor/github.com/google/go-github/v69/github/with_appengine.go b/vendor/github.com/google/go-github/v75/github/with_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/with_appengine.go rename to vendor/github.com/google/go-github/v75/github/with_appengine.go diff --git a/vendor/github.com/google/go-github/v69/github/without_appengine.go b/vendor/github.com/google/go-github/v75/github/without_appengine.go similarity index 100% rename from vendor/github.com/google/go-github/v69/github/without_appengine.go rename to vendor/github.com/google/go-github/v75/github/without_appengine.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 8b5cbdaf6..f53501126 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -193,8 +193,8 @@ github.com/bmatcuk/doublestar/v4 # github.com/bombsimon/logrusr/v4 v4.1.0 ## explicit; go 1.17 github.com/bombsimon/logrusr/v4 -# github.com/bradleyfalzon/ghinstallation/v2 v2.14.0 -## explicit; go 1.22.0 +# github.com/bradleyfalzon/ghinstallation/v2 v2.17.0 +## explicit; go 1.24.0 github.com/bradleyfalzon/ghinstallation/v2 # github.com/casbin/casbin/v2 v2.103.0 ## explicit; go 1.13 @@ -420,9 +420,9 @@ github.com/google/go-cmp/cmp/internal/value # github.com/google/go-github/v66 v66.0.0 ## explicit; go 1.21 github.com/google/go-github/v66/github -# github.com/google/go-github/v69 v69.2.0 -## explicit; go 1.22.0 -github.com/google/go-github/v69/github +# github.com/google/go-github/v75 v75.0.0 +## explicit; go 1.24.0 +github.com/google/go-github/v75/github # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query