From b7012f0431227668fb0b1d73ac8ecaf80e4a3d13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:39:38 +0000 Subject: [PATCH] chore(deps): bump github.com/goreleaser/goreleaser in /tools Bumps [github.com/goreleaser/goreleaser](https://github.com/goreleaser/goreleaser) from 1.2.5 to 1.3.0. - [Release notes](https://github.com/goreleaser/goreleaser/releases) - [Changelog](https://github.com/goreleaser/goreleaser/blob/main/.goreleaser.yaml) - [Commits](https://github.com/goreleaser/goreleaser/compare/v1.2.5...v1.3.0) --- updated-dependencies: - dependency-name: github.com/goreleaser/goreleaser dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tools/go.mod | 14 +- tools/go.sum | 32 +-- .../vendor/code.gitea.io/sdk/gitea/client.go | 72 +++-- .../sdk/gitea/issue_milestone.go | 6 +- tools/vendor/code.gitea.io/sdk/gitea/pull.go | 6 +- tools/vendor/code.gitea.io/sdk/gitea/repo.go | 2 +- .../code.gitea.io/sdk/gitea/user_app.go | 2 +- .../vendor/code.gitea.io/sdk/gitea/version.go | 24 +- .../vendor/github.com/caarlos0/env/v6/env.go | 2 +- .../v2 => caarlos0/go-reddit/v3}/LICENSE | 0 .../go-reddit/v3}/reddit/account.go | 0 .../go-reddit/v3}/reddit/collection.go | 0 .../go-reddit/v3}/reddit/comment.go | 0 .../go-reddit/v3}/reddit/emoji.go | 0 .../go-reddit/v3}/reddit/errors.go | 0 .../go-reddit/v3}/reddit/flair.go | 0 .../go-reddit/v3}/reddit/gold.go | 0 .../go-reddit/v3}/reddit/listings.go | 0 .../go-reddit/v3}/reddit/live-thread.go | 0 .../go-reddit/v3}/reddit/message.go | 0 .../go-reddit/v3}/reddit/moderation.go | 0 .../go-reddit/v3}/reddit/multi.go | 0 .../go-reddit/v3}/reddit/post-and-comment.go | 0 .../go-reddit/v3}/reddit/post.go | 0 .../go-reddit/v3}/reddit/reddit-oauth.go | 0 .../go-reddit/v3}/reddit/reddit-options.go | 0 .../go-reddit/v3}/reddit/reddit-user-agent.go | 0 .../go-reddit/v3}/reddit/reddit.go | 2 +- .../go-reddit/v3}/reddit/stream.go | 0 .../go-reddit/v3}/reddit/streamer.go | 0 .../go-reddit/v3}/reddit/subreddit.go | 0 .../go-reddit/v3}/reddit/things.go | 0 .../go-reddit/v3}/reddit/timestamp.go | 0 .../go-reddit/v3}/reddit/user.go | 0 .../go-reddit/v3}/reddit/widget.go | 0 .../go-reddit/v3}/reddit/wiki.go | 0 .../github.com/dghubble/oauth1/CHANGES.md | 4 + .../github.com/dghubble/oauth1/config.go | 33 ++- .../google/go-github/{v39 => v41}/AUTHORS | 0 .../google/go-github/{v39 => v41}/LICENSE | 0 .../go-github/{v39 => v41}/github/actions.go | 0 .../{v39 => v41}/github/actions_artifacts.go | 6 +- .../github/actions_runner_groups.go | 0 .../{v39 => v41}/github/actions_runners.go | 0 .../{v39 => v41}/github/actions_secrets.go | 0 .../github/actions_workflow_jobs.go | 6 +- .../github/actions_workflow_runs.go | 25 +- .../{v39 => v41}/github/actions_workflows.go | 0 .../go-github/{v39 => v41}/github/activity.go | 0 .../{v39 => v41}/github/activity_events.go | 0 .../github/activity_notifications.go | 0 .../{v39 => v41}/github/activity_star.go | 0 .../{v39 => v41}/github/activity_watching.go | 0 .../go-github/{v39 => v41}/github/admin.go | 0 .../{v39 => v41}/github/admin_orgs.go | 0 .../{v39 => v41}/github/admin_stats.go | 0 .../{v39 => v41}/github/admin_users.go | 0 .../go-github/{v39 => v41}/github/apps.go | 0 .../{v39 => v41}/github/apps_hooks.go | 0 .../{v39 => v41}/github/apps_installation.go | 0 .../{v39 => v41}/github/apps_manifest.go | 0 .../{v39 => v41}/github/apps_marketplace.go | 0 .../{v39 => v41}/github/authorizations.go | 0 .../go-github/{v39 => v41}/github/billing.go | 74 ++++- .../go-github/{v39 => v41}/github/checks.go | 0 .../{v39 => v41}/github/code-scanning.go | 44 +++ .../go-github/{v39 => v41}/github/doc.go | 2 +- .../{v39 => v41}/github/enterprise.go | 0 .../github/enterprise_actions_runners.go | 0 .../github/enterprise_audit_log.go | 0 .../go-github/{v39 => v41}/github/event.go | 0 .../{v39 => v41}/github/event_types.go | 0 .../go-github/{v39 => v41}/github/gists.go | 0 .../{v39 => v41}/github/gists_comments.go | 0 .../go-github/{v39 => v41}/github/git.go | 0 .../{v39 => v41}/github/git_blobs.go | 0 .../{v39 => v41}/github/git_commits.go | 0 .../go-github/{v39 => v41}/github/git_refs.go | 0 .../go-github/{v39 => v41}/github/git_tags.go | 0 .../{v39 => v41}/github/git_trees.go | 0 .../{v39 => v41}/github/github-accessors.go | 272 +++++++++++++++++- .../go-github/{v39 => v41}/github/github.go | 31 +- .../{v39 => v41}/github/gitignore.go | 0 .../{v39 => v41}/github/interactions.go | 0 .../{v39 => v41}/github/interactions_orgs.go | 0 .../{v39 => v41}/github/interactions_repos.go | 0 .../{v39 => v41}/github/issue_import.go | 0 .../go-github/{v39 => v41}/github/issues.go | 23 ++ .../{v39 => v41}/github/issues_assignees.go | 0 .../{v39 => v41}/github/issues_comments.go | 0 .../{v39 => v41}/github/issues_events.go | 0 .../{v39 => v41}/github/issues_labels.go | 0 .../{v39 => v41}/github/issues_milestones.go | 0 .../{v39 => v41}/github/issues_timeline.go | 25 +- .../go-github/{v39 => v41}/github/licenses.go | 0 .../go-github/{v39 => v41}/github/messages.go | 0 .../{v39 => v41}/github/migrations.go | 0 .../github/migrations_source_import.go | 0 .../{v39 => v41}/github/migrations_user.go | 0 .../go-github/{v39 => v41}/github/misc.go | 0 .../go-github/{v39 => v41}/github/orgs.go | 0 .../github/orgs_actions_allowed.go | 0 .../github/orgs_actions_permissions.go | 0 .../{v39 => v41}/github/orgs_audit_log.go | 10 +- .../{v39 => v41}/github/orgs_hooks.go | 0 .../github/orgs_hooks_deliveries.go | 0 .../{v39 => v41}/github/orgs_members.go | 0 .../github/orgs_outside_collaborators.go | 0 .../{v39 => v41}/github/orgs_packages.go | 0 .../{v39 => v41}/github/orgs_projects.go | 0 .../github/orgs_users_blocking.go | 0 .../go-github/{v39 => v41}/github/packages.go | 0 .../go-github/{v39 => v41}/github/projects.go | 0 .../go-github/{v39 => v41}/github/pulls.go | 0 .../{v39 => v41}/github/pulls_comments.go | 0 .../{v39 => v41}/github/pulls_reviewers.go | 0 .../{v39 => v41}/github/pulls_reviews.go | 0 .../{v39 => v41}/github/reactions.go | 26 ++ .../go-github/{v39 => v41}/github/repos.go | 64 +++++ .../{v39 => v41}/github/repos_autolinks.go | 0 .../github/repos_collaborators.go | 0 .../{v39 => v41}/github/repos_comments.go | 0 .../{v39 => v41}/github/repos_commits.go | 0 .../github/repos_community_health.go | 0 .../{v39 => v41}/github/repos_contents.go | 0 .../{v39 => v41}/github/repos_deployments.go | 0 .../{v39 => v41}/github/repos_environments.go | 0 .../{v39 => v41}/github/repos_forks.go | 0 .../{v39 => v41}/github/repos_hooks.go | 0 .../github/repos_hooks_deliveries.go | 0 .../{v39 => v41}/github/repos_invitations.go | 0 .../{v39 => v41}/github/repos_keys.go | 0 .../{v39 => v41}/github/repos_merging.go | 0 .../{v39 => v41}/github/repos_pages.go | 0 .../github/repos_prereceive_hooks.go | 0 .../{v39 => v41}/github/repos_projects.go | 0 .../{v39 => v41}/github/repos_releases.go | 0 .../{v39 => v41}/github/repos_stats.go | 0 .../{v39 => v41}/github/repos_statuses.go | 0 .../{v39 => v41}/github/repos_traffic.go | 0 .../go-github/{v39 => v41}/github/scim.go | 0 .../go-github/{v39 => v41}/github/search.go | 0 .../go-github/{v39 => v41}/github/strings.go | 0 .../go-github/{v39 => v41}/github/teams.go | 0 .../github/teams_discussion_comments.go | 0 .../{v39 => v41}/github/teams_discussions.go | 0 .../{v39 => v41}/github/teams_members.go | 0 .../{v39 => v41}/github/timestamp.go | 0 .../go-github/{v39 => v41}/github/users.go | 0 .../github/users_administration.go | 0 .../{v39 => v41}/github/users_blocking.go | 0 .../{v39 => v41}/github/users_emails.go | 0 .../{v39 => v41}/github/users_followers.go | 0 .../{v39 => v41}/github/users_gpg_keys.go | 0 .../{v39 => v41}/github/users_keys.go | 0 .../{v39 => v41}/github/users_packages.go | 2 +- .../{v39 => v41}/github/users_projects.go | 0 .../{v39 => v41}/github/with_appengine.go | 0 .../{v39 => v41}/github/without_appengine.go | 0 .../goreleaser/goreleaser/Dockerfile | 2 +- .../github.com/goreleaser/goreleaser/USERS.md | 2 + .../goreleaser/internal/client/gitea.go | 4 +- .../goreleaser/internal/client/github.go | 2 +- .../goreleaser/internal/client/gitlab.go | 70 +++-- .../internal/commitauthor/author.go | 37 +++ .../goreleaser/internal/exec/exec.go | 15 + .../internal/pipe/announce/announce.go | 2 + .../goreleaser/internal/pipe/brew/brew.go | 16 +- .../internal/pipe/changelog/changelog.go | 130 +++++---- .../internal/pipe/defaults/defaults.go | 7 +- .../goreleaser/internal/pipe/docker/docker.go | 6 +- .../goreleaser/internal/pipe/gofish/gofish.go | 15 +- .../goreleaser/internal/pipe/krew/krew.go | 15 +- .../goreleaser/internal/pipe/reddit/reddit.go | 2 +- .../goreleaser/internal/pipe/scoop/scoop.go | 15 +- .../pipe/universalbinary/universalbinary.go | 5 +- .../internal/pipe/webhook/webhook.go | 119 ++++++++ .../goreleaser/pkg/config/config.go | 35 ++- .../goreleaser/pkg/defaults/defaults.go | 2 + .../github.com/slack-go/slack/README.md | 4 +- tools/vendor/modules.txt | 24 +- 181 files changed, 1106 insertions(+), 232 deletions(-) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/LICENSE (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/account.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/collection.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/comment.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/emoji.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/errors.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/flair.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/gold.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/listings.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/live-thread.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/message.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/moderation.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/multi.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/post-and-comment.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/post.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/reddit-oauth.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/reddit-options.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/reddit-user-agent.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/reddit.go (99%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/stream.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/streamer.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/subreddit.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/things.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/timestamp.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/user.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/widget.go (100%) rename tools/vendor/github.com/{vartanbeno/go-reddit/v2 => caarlos0/go-reddit/v3}/reddit/wiki.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/AUTHORS (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/LICENSE (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_artifacts.go (97%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_runner_groups.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_runners.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_secrets.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_workflow_jobs.go (94%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_workflow_runs.go (91%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/actions_workflows.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/activity.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/activity_events.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/activity_notifications.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/activity_star.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/activity_watching.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/admin.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/admin_orgs.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/admin_stats.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/admin_users.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/apps.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/apps_hooks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/apps_installation.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/apps_manifest.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/apps_marketplace.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/authorizations.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/billing.go (68%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/checks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/code-scanning.go (79%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/doc.go (99%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/enterprise.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/enterprise_actions_runners.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/enterprise_audit_log.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/event.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/event_types.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/gists.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/gists_comments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/git.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/git_blobs.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/git_commits.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/git_refs.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/git_tags.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/git_trees.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/github-accessors.go (98%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/github.go (96%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/gitignore.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/interactions.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/interactions_orgs.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/interactions_repos.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issue_import.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues.go (94%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues_assignees.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues_comments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues_events.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues_labels.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues_milestones.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/issues_timeline.go (85%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/licenses.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/messages.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/migrations.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/migrations_source_import.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/migrations_user.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/misc.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_actions_allowed.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_actions_permissions.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_audit_log.go (92%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_hooks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_hooks_deliveries.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_members.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_outside_collaborators.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_packages.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_projects.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/orgs_users_blocking.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/packages.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/projects.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/pulls.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/pulls_comments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/pulls_reviewers.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/pulls_reviews.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/reactions.go (95%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos.go (96%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_autolinks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_collaborators.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_comments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_commits.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_community_health.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_contents.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_deployments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_environments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_forks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_hooks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_hooks_deliveries.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_invitations.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_keys.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_merging.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_pages.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_prereceive_hooks.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_projects.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_releases.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_stats.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_statuses.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/repos_traffic.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/scim.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/search.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/strings.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/teams.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/teams_discussion_comments.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/teams_discussions.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/teams_members.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/timestamp.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_administration.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_blocking.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_emails.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_followers.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_gpg_keys.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_keys.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_packages.go (99%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/users_projects.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/with_appengine.go (100%) rename tools/vendor/github.com/google/go-github/{v39 => v41}/github/without_appengine.go (100%) create mode 100644 tools/vendor/github.com/goreleaser/goreleaser/internal/commitauthor/author.go create mode 100644 tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/webhook/webhook.go diff --git a/tools/go.mod b/tools/go.mod index 0682a793..82d367de 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/axw/gocov v1.0.0 github.com/golangci/golangci-lint v1.43.0 - github.com/goreleaser/goreleaser v1.2.5 + github.com/goreleaser/goreleaser v1.3.0 github.com/matm/gocov-html v0.0.0-20200509184451-71874e2e203b github.com/mattn/goveralls v0.0.11 github.com/obalunenko/coverbadger v1.1.0 @@ -18,7 +18,7 @@ require ( cloud.google.com/go v0.99.0 // indirect cloud.google.com/go/kms v1.1.0 // indirect cloud.google.com/go/storage v1.18.2 // indirect - code.gitea.io/sdk/gitea v0.15.0 // indirect + code.gitea.io/sdk/gitea v0.15.1 // indirect github.com/AlekSi/pointer v1.2.0 // indirect github.com/Antonboom/errname v0.1.5 // indirect github.com/Antonboom/nilnil v0.1.0 // indirect @@ -75,7 +75,8 @@ require ( github.com/breml/bidichk v0.1.1 // indirect github.com/butuzov/ireturn v0.1.1 // indirect github.com/caarlos0/ctrlc v1.0.0 // indirect - github.com/caarlos0/env/v6 v6.8.0 // indirect + github.com/caarlos0/env/v6 v6.9.1 // indirect + github.com/caarlos0/go-reddit/v3 v3.0.1 // indirect github.com/caarlos0/go-shellwords v1.0.12 // indirect github.com/cavaliergopher/cpio v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.1.2 // indirect @@ -90,7 +91,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/denis-tingajkin/go-header v0.4.2 // indirect github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb // indirect - github.com/dghubble/oauth1 v0.7.0 // indirect + github.com/dghubble/oauth1 v0.7.1 // indirect github.com/dghubble/sling v1.4.0 // indirect github.com/dimchansky/utfbom v1.1.1 // indirect github.com/dnephin/pflag v1.0.7 // indirect @@ -131,7 +132,7 @@ require ( github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/go-cmp v0.5.6 // indirect - github.com/google/go-github/v39 v39.2.0 // indirect + github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/rpmpack v0.0.0-20211125064518-d0ed9b1b61b9 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -215,7 +216,7 @@ require ( github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/sivchari/tenv v1.4.7 // indirect - github.com/slack-go/slack v0.10.0 // indirect + github.com/slack-go/slack v0.10.1 // indirect github.com/sonatard/noctx v0.0.1 // indirect github.com/sourcegraph/go-diff v0.6.1 // indirect github.com/spf13/afero v1.6.0 // indirect @@ -239,7 +240,6 @@ require ( github.com/ultraware/funlen v0.0.3 // indirect github.com/ultraware/whitespace v0.0.4 // indirect github.com/uudashr/gocognit v1.0.5 // indirect - github.com/vartanbeno/go-reddit/v2 v2.0.1 // indirect github.com/xanzy/go-gitlab v0.52.2 // indirect github.com/xanzy/ssh-agent v0.3.1 // indirect github.com/yeya24/promlinter v0.1.0 // indirect diff --git a/tools/go.sum b/tools/go.sum index 6b358133..8a33e6b7 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -74,8 +74,8 @@ cloud.google.com/go/storage v1.18.2 h1:5NQw6tOn3eMm0oE8vTkfjau18kjL79FlMjy/CHTpm cloud.google.com/go/storage v1.18.2/go.mod h1:AiIj7BWXyhO5gGVmYJ+S8tbkCx3yb0IMjua8Aw4naVM= cloud.google.com/go/trace v0.1.0/go.mod h1:wxEwsoeRVPbeSkt7ZC9nWCgmoKQRAoySN7XHW2AmI7g= code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= -code.gitea.io/sdk/gitea v0.15.0 h1:tsNhxDM/2N1Ohv1Xq5UWrht/esg0WmtRj4wsHVHriTg= -code.gitea.io/sdk/gitea v0.15.0/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA= +code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M= +code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA= contrib.go.opencensus.io/exporter/aws v0.0.0-20200617204711-c478e41e60e9/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= contrib.go.opencensus.io/exporter/stackdriver v0.13.8/go.mod h1:huNtlWx75MwO7qMs0KrMxPZXzNNWebav1Sq/pm02JdQ= @@ -294,8 +294,10 @@ github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/caarlos0/ctrlc v1.0.0 h1:2DtF8GSIcajgffDFJzyG15vO+1PuBWOMUdFut7NnXhw= github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= -github.com/caarlos0/env/v6 v6.8.0 h1:abF9JinEXaibthiOowf4uSnRBWN66aJOxSpHLH67jeI= -github.com/caarlos0/env/v6 v6.8.0/go.mod h1:FE0jGiAnQqtv2TenJ4KTa8+/T2Ss8kdS5s1VEjasoN0= +github.com/caarlos0/env/v6 v6.9.1 h1:zOkkjM0F6ltnQ5eBX6IPI41UP/KDGEK7rRPwGCNos8k= +github.com/caarlos0/env/v6 v6.9.1/go.mod h1:hvp/ryKXKipEkcuYjs9mI4bBCg+UI0Yhgm5Zu0ddvwc= +github.com/caarlos0/go-reddit/v3 v3.0.1 h1:w8ugvsrHhaE/m4ez0BO/sTBOBWI9WZTjG7VTecHnql4= +github.com/caarlos0/go-reddit/v3 v3.0.1/go.mod h1:QlwgmG5SAqxMeQvg/A2dD1x9cIZCO56BMnMdjXLoisI= github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11 h1:IRrDwVlWQr6kS1U8/EtyA1+EHcc4yl8pndcqXWrEamg= github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11/go.mod h1:je2KZ+LxaCNvCoKg32jtOIULcFogJKcL1ZWUaIBjKj0= github.com/caarlos0/go-shellwords v1.0.12 h1:HWrUnu6lGbWfrDcFiHcZiwOLzHWjjrPVehULaTFgPp8= @@ -371,8 +373,8 @@ github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27N github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb h1:7ENzkH+O3juL+yj2undESLTaAeRllHwCs/b8z6aWSfc= github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb/go.mod h1:qhZBgV9e4WyB1JNjHpcXVkUe3knWUwYuAPB1hITdm50= -github.com/dghubble/oauth1 v0.7.0 h1:AlpZdbRiJM4XGHIlQ8BuJ/wlpGwFEJNnB4Mc+78tA/w= -github.com/dghubble/oauth1 v0.7.0/go.mod h1:8pFdfPkv/jr8mkChVbNVuJ0suiHe278BtWI4Tk1ujxk= +github.com/dghubble/oauth1 v0.7.1 h1:JjbOVSVVkms9A4h/sTQy5Jb2nFuAAVb2qVYgenJPyrE= +github.com/dghubble/oauth1 v0.7.1/go.mod h1:0eEzON0UY/OLACQrmnjgJjmvCGXzjBCsZqL1kWDXtF0= github.com/dghubble/sling v1.4.0 h1:/n8MRosVTthvMbwlNZgLx579OGVjUOy3GNEv5BIqAWY= github.com/dghubble/sling v1.4.0/go.mod h1:0r40aNsU9EdDUVBNhfCstAtFgutjgJGYbO1oNzkMoM8= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -576,8 +578,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github/v39 v39.2.0 h1:rNNM311XtPOz5rDdsJXAp2o8F67X9FnROXTvto3aSnQ= -github.com/google/go-github/v39 v39.2.0/go.mod h1:C1s8C5aCC9L+JXIYpJM5GYytdX52vC1bLvHEF1IhBrE= +github.com/google/go-github/v41 v41.0.0 h1:HseJrM2JFf2vfiZJ8anY2hqBjdfY1Vlj/K27ueww4gg= +github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= @@ -642,8 +644,8 @@ github.com/goreleaser/chglog v0.1.2 h1:tdzAb/ILeMnphzI9zQ7Nkq+T8R9qyXli8GydD8plF github.com/goreleaser/chglog v0.1.2/go.mod h1:tTZsFuSZK4epDXfjMkxzcGbrIOXprf0JFp47BjIr3B8= github.com/goreleaser/fileglob v1.2.0 h1:OErqbdzeg/eibfDGPHDQDN8jL5u1jNyxA5IQzNPLLoU= github.com/goreleaser/fileglob v1.2.0/go.mod h1:rFyb2pXaK3YdnYnSjn6lifw0h2Q6s8OfOsx6I6bXkKE= -github.com/goreleaser/goreleaser v1.2.5 h1:9awLYnwOvTErPYhZkkkKO5cfSouGjM+wREhj3ICzXJc= -github.com/goreleaser/goreleaser v1.2.5/go.mod h1:pJqa752MOnUtzhZqZFowX9ChwSKSS1RO5zDw3IbYG0o= +github.com/goreleaser/goreleaser v1.3.0 h1:ycOSnMI9a98TvWKWujy+N2CxHElI36VoS6GM64uIP60= +github.com/goreleaser/goreleaser v1.3.0/go.mod h1:RiKJLXOX4WVDW7whP8hWTkVjzrjund6wXDzjBCCQpz0= github.com/goreleaser/nfpm/v2 v2.11.3 h1:FoPqUv5HAcyTp76LQCvhX4ZhG1UdeClxjmYlwiWXb/k= github.com/goreleaser/nfpm/v2 v2.11.3/go.mod h1:JDzAE2Jy8WsqZu4d7MIl6vhHTbc8ESZgqpfTA0hKdLQ= github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= @@ -748,8 +750,8 @@ github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jarcoal/httpmock v1.0.8 h1:8kI16SoO6LQKgPE7PvQuV+YuD/inwHd7fOOe2zMbo4k= -github.com/jarcoal/httpmock v1.0.8/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= +github.com/jarcoal/httpmock v1.1.0 h1:F47ChZj1Y2zFsCXxNkBPwNNKnAyOATcdQibk0qEdVCE= +github.com/jarcoal/httpmock v1.1.0/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -1077,8 +1079,8 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sivchari/tenv v1.4.7 h1:FdTpgRlTue5eb5nXIYgS/lyVXSjugU8UUVDwhP1NLU8= github.com/sivchari/tenv v1.4.7/go.mod h1:5nF+bITvkebQVanjU6IuMbvIot/7ReNsUV7I5NbprB0= -github.com/slack-go/slack v0.10.0 h1:L16Eqg3QZzRKGXIVsFSZdJdygjOphb2FjRUwH6VrFu8= -github.com/slack-go/slack v0.10.0/go.mod h1:wWL//kk0ho+FcQXcBTmEafUI5dz4qz5f4mMk8oIkioQ= +github.com/slack-go/slack v0.10.1 h1:BGbxa0kMsGEvLOEoZmYs8T1wWfoZXwmQFBb6FgYCXUA= +github.com/slack-go/slack v0.10.1/go.mod h1:wWL//kk0ho+FcQXcBTmEafUI5dz4qz5f4mMk8oIkioQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= @@ -1188,8 +1190,6 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/vartanbeno/go-reddit/v2 v2.0.1 h1:P6ITpf5YHjdy7DHZIbUIDn/iNAoGcEoDQnMa+L4vutw= -github.com/vartanbeno/go-reddit/v2 v2.0.1/go.mod h1:758/S10hwZSLm43NPtwoNQdZFSg3sjB5745Mwjb0ANI= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= github.com/xanzy/go-gitlab v0.52.2 h1:gkgg1z4ON70sphibtD86Bfmt1qV3mZ0pU0CBBCFAEvQ= github.com/xanzy/go-gitlab v0.52.2/go.mod h1:Q+hQhV508bDPoBijv7YjK/Lvlb4PhVhJdKqXVQrUoAE= diff --git a/tools/vendor/code.gitea.io/sdk/gitea/client.go b/tools/vendor/code.gitea.io/sdk/gitea/client.go index 9f857f85..3fe3e8bd 100644 --- a/tools/vendor/code.gitea.io/sdk/gitea/client.go +++ b/tools/vendor/code.gitea.io/sdk/gitea/client.go @@ -24,23 +24,25 @@ var jsonHeader = http.Header{"content-type": []string{"application/json"}} // Version return the library version func Version() string { - return "0.14.0" + return "0.15.1" } // Client represents a thread-safe Gitea API client. type Client struct { - url string - accessToken string - username string - password string - otp string - sudo string - debug bool - client *http.Client - ctx context.Context - mutex sync.RWMutex + url string + accessToken string + username string + password string + otp string + sudo string + debug bool + client *http.Client + ctx context.Context + mutex sync.RWMutex + serverVersion *version.Version getVersionOnce sync.Once + ignoreVersion bool // only set by SetGiteaVersion so don't need a mutex lock } // Response represents the gitea response @@ -48,16 +50,21 @@ type Response struct { *http.Response } +// ClientOption are functions used to init a new client +type ClientOption func(*Client) error + // NewClient initializes and returns a API client. // Usage of all gitea.Client methods is concurrency-safe. -func NewClient(url string, options ...func(*Client)) (*Client, error) { +func NewClient(url string, options ...ClientOption) (*Client, error) { client := &Client{ url: strings.TrimSuffix(url, "/"), client: &http.Client{}, ctx: context.Background(), } for _, opt := range options { - opt(client) + if err := opt(client); err != nil { + return nil, err + } } if err := client.checkServerVersionGreaterThanOrEqual(version1_11_0); err != nil { return nil, err @@ -73,9 +80,10 @@ func NewClientWithHTTP(url string, httpClient *http.Client) *Client { } // SetHTTPClient is an option for NewClient to set custom http client -func SetHTTPClient(httpClient *http.Client) func(client *Client) { - return func(client *Client) { +func SetHTTPClient(httpClient *http.Client) ClientOption { + return func(client *Client) error { client.SetHTTPClient(httpClient) + return nil } } @@ -87,18 +95,20 @@ func (c *Client) SetHTTPClient(client *http.Client) { } // SetToken is an option for NewClient to set token -func SetToken(token string) func(client *Client) { - return func(client *Client) { +func SetToken(token string) ClientOption { + return func(client *Client) error { client.mutex.Lock() client.accessToken = token client.mutex.Unlock() + return nil } } // SetBasicAuth is an option for NewClient to set username and password -func SetBasicAuth(username, password string) func(client *Client) { - return func(client *Client) { +func SetBasicAuth(username, password string) ClientOption { + return func(client *Client) error { client.SetBasicAuth(username, password) + return nil } } @@ -110,9 +120,10 @@ func (c *Client) SetBasicAuth(username, password string) { } // SetOTP is an option for NewClient to set OTP for 2FA -func SetOTP(otp string) func(client *Client) { - return func(client *Client) { +func SetOTP(otp string) ClientOption { + return func(client *Client) error { client.SetOTP(otp) + return nil } } @@ -123,14 +134,15 @@ func (c *Client) SetOTP(otp string) { c.mutex.Unlock() } -// SetContext is an option for NewClient to set context -func SetContext(ctx context.Context) func(client *Client) { - return func(client *Client) { +// SetContext is an option for NewClient to set the default context +func SetContext(ctx context.Context) ClientOption { + return func(client *Client) error { client.SetContext(ctx) + return nil } } -// SetContext set context witch is used for http requests +// SetContext set default context witch is used for http requests func (c *Client) SetContext(ctx context.Context) { c.mutex.Lock() c.ctx = ctx @@ -138,9 +150,10 @@ func (c *Client) SetContext(ctx context.Context) { } // SetSudo is an option for NewClient to set sudo header -func SetSudo(sudo string) func(client *Client) { - return func(client *Client) { +func SetSudo(sudo string) ClientOption { + return func(client *Client) error { client.SetSudo(sudo) + return nil } } @@ -152,11 +165,12 @@ func (c *Client) SetSudo(sudo string) { } // SetDebugMode is an option for NewClient to enable debug mode -func SetDebugMode() func(client *Client) { - return func(client *Client) { +func SetDebugMode() ClientOption { + return func(client *Client) error { client.mutex.Lock() client.debug = true client.mutex.Unlock() + return nil } } diff --git a/tools/vendor/code.gitea.io/sdk/gitea/issue_milestone.go b/tools/vendor/code.gitea.io/sdk/gitea/issue_milestone.go index a865a458..dfb5720a 100644 --- a/tools/vendor/code.gitea.io/sdk/gitea/issue_milestone.go +++ b/tools/vendor/code.gitea.io/sdk/gitea/issue_milestone.go @@ -73,7 +73,7 @@ func (c *Client) GetMilestone(owner, repo string, id int64) (*Milestone, *Respon // GetMilestoneByName get one milestone by repo and milestone name func (c *Client) GetMilestoneByName(owner, repo string, name string) (*Milestone, *Response, error) { - if c.CheckServerVersionConstraint(">=1.13") != nil { + if c.checkServerVersionGreaterThanOrEqual(version1_13_0) != nil { // backwards compatibility mode m, resp, err := c.resolveMilestoneByName(owner, repo, name) return m, resp, err @@ -164,7 +164,7 @@ func (c *Client) EditMilestone(owner, repo string, id int64, opt EditMilestoneOp // EditMilestoneByName modify milestone with options func (c *Client) EditMilestoneByName(owner, repo string, name string, opt EditMilestoneOption) (*Milestone, *Response, error) { - if c.CheckServerVersionConstraint(">=1.13") != nil { + if c.checkServerVersionGreaterThanOrEqual(version1_13_0) != nil { // backwards compatibility mode m, _, err := c.resolveMilestoneByName(owner, repo, name) if err != nil { @@ -198,7 +198,7 @@ func (c *Client) DeleteMilestone(owner, repo string, id int64) (*Response, error // DeleteMilestoneByName delete one milestone by name func (c *Client) DeleteMilestoneByName(owner, repo string, name string) (*Response, error) { - if c.CheckServerVersionConstraint(">=1.13") != nil { + if c.checkServerVersionGreaterThanOrEqual(version1_13_0) != nil { // backwards compatibility mode m, _, err := c.resolveMilestoneByName(owner, repo, name) if err != nil { diff --git a/tools/vendor/code.gitea.io/sdk/gitea/pull.go b/tools/vendor/code.gitea.io/sdk/gitea/pull.go index 9528762b..e0198c28 100644 --- a/tools/vendor/code.gitea.io/sdk/gitea/pull.go +++ b/tools/vendor/code.gitea.io/sdk/gitea/pull.go @@ -12,6 +12,8 @@ import ( "net/url" "strings" "time" + + "github.com/hashicorp/go-version" ) // PRBranchInfo information about a branch @@ -214,10 +216,12 @@ type MergePullRequestOption struct { Message string `json:"MergeMessageField"` } +var version1_11_5, _ = version.NewVersion("1.11.5") + // Validate the MergePullRequestOption struct func (opt MergePullRequestOption) Validate(c *Client) error { if opt.Style == MergeStyleSquash { - if err := c.CheckServerVersionConstraint(">=1.11.5"); err != nil { + if err := c.checkServerVersionGreaterThanOrEqual(version1_11_5); err != nil { return err } } diff --git a/tools/vendor/code.gitea.io/sdk/gitea/repo.go b/tools/vendor/code.gitea.io/sdk/gitea/repo.go index 9c669ae9..62d13a3a 100644 --- a/tools/vendor/code.gitea.io/sdk/gitea/repo.go +++ b/tools/vendor/code.gitea.io/sdk/gitea/repo.go @@ -335,7 +335,7 @@ func (opt CreateRepoOption) Validate(c *Client) error { return fmt.Errorf("name has more than 100 chars") } if len(opt.TrustModel) != 0 { - if err := c.CheckServerVersionConstraint(">=1.13.0"); err != nil { + if err := c.checkServerVersionGreaterThanOrEqual(version1_13_0); err != nil { return err } } diff --git a/tools/vendor/code.gitea.io/sdk/gitea/user_app.go b/tools/vendor/code.gitea.io/sdk/gitea/user_app.go index 2921eea7..88b01ed0 100644 --- a/tools/vendor/code.gitea.io/sdk/gitea/user_app.go +++ b/tools/vendor/code.gitea.io/sdk/gitea/user_app.go @@ -77,7 +77,7 @@ func (c *Client) DeleteAccessToken(value interface{}) (*Response, error) { case reflect.Int64: token = fmt.Sprintf("%d", value.(int64)) case reflect.String: - if err := c.CheckServerVersionConstraint(">= 1.13.0"); err != nil { + if err := c.checkServerVersionGreaterThanOrEqual(version1_13_0); err != nil { return nil, err } token = value.(string) diff --git a/tools/vendor/code.gitea.io/sdk/gitea/version.go b/tools/vendor/code.gitea.io/sdk/gitea/version.go index 449ad97f..1f41c771 100644 --- a/tools/vendor/code.gitea.io/sdk/gitea/version.go +++ b/tools/vendor/code.gitea.io/sdk/gitea/version.go @@ -39,6 +39,25 @@ func (c *Client) CheckServerVersionConstraint(constraint string) error { return nil } +// SetGiteaVersion configures the Client to assume the given version of the +// Gitea server, instead of querying the server for it when initializing. +// Use "" to skip all canonical ways in the SDK to check for versions +func SetGiteaVersion(v string) ClientOption { + if v == "" { + return func(c *Client) error { + c.ignoreVersion = true + return nil + } + } + return func(c *Client) (err error) { + c.getVersionOnce.Do(func() { + c.serverVersion, err = version.NewVersion(v) + return + }) + return + } +} + // predefined versions only have to be parsed by library once var ( version1_11_0, _ = version.NewVersion("1.11.0") @@ -48,8 +67,11 @@ var ( version1_15_0, _ = version.NewVersion("1.15.0") ) -// checkServerVersionGreaterThanOrEqual is internally used to speed up things and ignore issues with prerelease +// checkServerVersionGreaterThanOrEqual is the canonical way in the SDK to check for versions for API compatibility reasons func (c *Client) checkServerVersionGreaterThanOrEqual(v *version.Version) error { + if c.ignoreVersion { + return nil + } if err := c.loadServerVersion(); err != nil { return err } diff --git a/tools/vendor/github.com/caarlos0/env/v6/env.go b/tools/vendor/github.com/caarlos0/env/v6/env.go index 6279555d..20366959 100644 --- a/tools/vendor/github.com/caarlos0/env/v6/env.go +++ b/tools/vendor/github.com/caarlos0/env/v6/env.go @@ -216,7 +216,7 @@ func doParse(ref reflect.Value, funcMap map[reflect.Type]ParserFunc, opts []Opti continue } if reflect.Struct == refField.Kind() && refField.CanAddr() && refField.Type().Name() == "" { - if err := Parse(refField.Addr().Interface(), opts...); err != nil { + if err := Parse(refField.Addr().Interface(), optsWithPrefix(refType.Field(i), opts)...); err != nil { return err } continue diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/LICENSE b/tools/vendor/github.com/caarlos0/go-reddit/v3/LICENSE similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/LICENSE rename to tools/vendor/github.com/caarlos0/go-reddit/v3/LICENSE diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/account.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/account.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/account.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/account.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/collection.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/collection.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/collection.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/collection.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/comment.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/comment.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/comment.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/comment.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/emoji.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/emoji.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/emoji.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/emoji.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/errors.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/errors.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/errors.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/errors.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/flair.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/flair.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/flair.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/flair.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/gold.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/gold.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/gold.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/gold.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/listings.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/listings.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/listings.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/listings.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/live-thread.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/live-thread.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/live-thread.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/live-thread.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/message.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/message.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/message.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/message.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/moderation.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/moderation.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/moderation.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/moderation.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/multi.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/multi.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/multi.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/multi.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/post-and-comment.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/post-and-comment.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/post-and-comment.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/post-and-comment.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/post.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/post.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/post.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/post.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit-oauth.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit-oauth.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit-oauth.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit-oauth.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit-options.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit-options.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit-options.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit-options.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit-user-agent.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit-user-agent.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit-user-agent.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit-user-agent.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit.go similarity index 99% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit.go index bafda0c1..7705b8d3 100644 --- a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/reddit.go +++ b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/reddit.go @@ -20,7 +20,7 @@ import ( ) const ( - libraryName = "github.com/vartanbeno/go-reddit" + libraryName = "github.com/caarlos0/go-reddit" libraryVersion = "2.0.0" defaultBaseURL = "https://oauth.reddit.com" diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/stream.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/stream.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/stream.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/stream.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/streamer.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/streamer.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/streamer.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/streamer.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/subreddit.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/subreddit.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/subreddit.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/subreddit.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/things.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/things.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/things.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/things.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/timestamp.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/timestamp.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/timestamp.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/timestamp.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/user.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/user.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/user.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/user.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/widget.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/widget.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/widget.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/widget.go diff --git a/tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/wiki.go b/tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/wiki.go similarity index 100% rename from tools/vendor/github.com/vartanbeno/go-reddit/v2/reddit/wiki.go rename to tools/vendor/github.com/caarlos0/go-reddit/v3/reddit/wiki.go diff --git a/tools/vendor/github.com/dghubble/oauth1/CHANGES.md b/tools/vendor/github.com/dghubble/oauth1/CHANGES.md index 67602940..e9ec0bcc 100644 --- a/tools/vendor/github.com/dghubble/oauth1/CHANGES.md +++ b/tools/vendor/github.com/dghubble/oauth1/CHANGES.md @@ -4,6 +4,10 @@ Notable changes between releases. ## Latest +## v0.7.1 + +* Show body when `RequestToken` or `AccessToken` requests return an invalid status code ([#54](https://github.com/dghubble/oauth1/pull/54)) + ## v0.7.0 * Add an `HMAC256Signer` ([#40](https://github.com/dghubble/oauth1/pull/40)) diff --git a/tools/vendor/github.com/dghubble/oauth1/config.go b/tools/vendor/github.com/dghubble/oauth1/config.go index a0124ff7..c539a00b 100644 --- a/tools/vendor/github.com/dghubble/oauth1/config.go +++ b/tools/vendor/github.com/dghubble/oauth1/config.go @@ -31,6 +31,8 @@ type Config struct { Signer Signer // Noncer creates request nonces (defaults to DefaultNoncer) Noncer Noncer + // HTTPClient overrides the choice of http.DefaultClient for RequestToken and AccessToken + HTTPClient *http.Client } // NewConfig returns a new Config with the given consumer key and secret. @@ -71,19 +73,21 @@ func (c *Config) RequestToken() (requestToken, requestSecret string, err error) if err != nil { return "", "", err } - resp, err := http.DefaultClient.Do(req) + resp, err := c.httpClient().Do(req) if err != nil { return "", "", err } // when err is nil, resp contains a non-nil resp.Body which must be closed defer resp.Body.Close() - if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { - return "", "", fmt.Errorf("oauth1: Server returned status %d", resp.StatusCode) - } + body, err := ioutil.ReadAll(resp.Body) if err != nil { - return "", "", err + return "", "", fmt.Errorf("oauth1: error reading Body: %v", err) } + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { + return "", "", fmt.Errorf("oauth1: invalid status %d: %s", resp.StatusCode, body) + } + // ParseQuery to decode URL-encoded application/x-www-form-urlencoded body values, err := url.ParseQuery(string(body)) if err != nil { @@ -148,19 +152,21 @@ func (c *Config) AccessToken(requestToken, requestSecret, verifier string) (acce if err != nil { return "", "", err } - resp, err := http.DefaultClient.Do(req) + resp, err := c.httpClient().Do(req) if err != nil { return "", "", err } // when err is nil, resp contains a non-nil resp.Body which must be closed defer resp.Body.Close() - if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { - return "", "", fmt.Errorf("oauth1: Server returned status %d", resp.StatusCode) - } + body, err := ioutil.ReadAll(resp.Body) if err != nil { - return "", "", err + return "", "", fmt.Errorf("oauth1: error reading Body: %v", err) + } + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { + return "", "", fmt.Errorf("oauth1: invalid status %d: %s", resp.StatusCode, body) } + // ParseQuery to decode URL-encoded application/x-www-form-urlencoded body values, err := url.ParseQuery(string(body)) if err != nil { @@ -173,3 +179,10 @@ func (c *Config) AccessToken(requestToken, requestSecret, verifier string) (acce } return accessToken, accessSecret, nil } + +func (c *Config) httpClient() *http.Client { + if c.HTTPClient != nil { + return c.HTTPClient + } + return http.DefaultClient +} diff --git a/tools/vendor/github.com/google/go-github/v39/AUTHORS b/tools/vendor/github.com/google/go-github/v41/AUTHORS similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/AUTHORS rename to tools/vendor/github.com/google/go-github/v41/AUTHORS diff --git a/tools/vendor/github.com/google/go-github/v39/LICENSE b/tools/vendor/github.com/google/go-github/v41/LICENSE similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/LICENSE rename to tools/vendor/github.com/google/go-github/v41/LICENSE diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions.go b/tools/vendor/github.com/google/go-github/v41/github/actions.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/actions.go rename to tools/vendor/github.com/google/go-github/v41/github/actions.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_artifacts.go b/tools/vendor/github.com/google/go-github/v41/github/actions_artifacts.go similarity index 97% rename from tools/vendor/github.com/google/go-github/v39/github/actions_artifacts.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_artifacts.go index 016ce7a1..4aa7dc44 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/actions_artifacts.go +++ b/tools/vendor/github.com/google/go-github/v41/github/actions_artifacts.go @@ -16,7 +16,7 @@ import ( // data between jobs in a workflow and provide storage for data // once a workflow is complete. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/artifacts/ +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#artifacts type Artifact struct { ID *int64 `json:"id,omitempty"` NodeID *string `json:"node_id,omitempty"` @@ -30,7 +30,7 @@ type Artifact struct { // ArtifactList represents a list of GitHub artifacts. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/artifacts/ +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#artifacts type ArtifactList struct { TotalCount *int64 `json:"total_count,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` @@ -106,7 +106,7 @@ func (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, ar // DownloadArtifact gets a redirect URL to download an archive for a repository. // -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/artifacts/#download-an-artifact +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#download-an-artifact func (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, followRedirects bool) (*url.URL, *Response, error) { u := fmt.Sprintf("repos/%v/%v/actions/artifacts/%v/zip", owner, repo, artifactID) diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_runner_groups.go b/tools/vendor/github.com/google/go-github/v41/github/actions_runner_groups.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/actions_runner_groups.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_runner_groups.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_runners.go b/tools/vendor/github.com/google/go-github/v41/github/actions_runners.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/actions_runners.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_runners.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_secrets.go b/tools/vendor/github.com/google/go-github/v41/github/actions_secrets.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/actions_secrets.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_secrets.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_workflow_jobs.go b/tools/vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go similarity index 94% rename from tools/vendor/github.com/google/go-github/v39/github/actions_workflow_jobs.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go index 86921bae..66b8ff6e 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/actions_workflow_jobs.go +++ b/tools/vendor/github.com/google/go-github/v41/github/actions_workflow_jobs.go @@ -39,7 +39,11 @@ type WorkflowJob struct { Steps []*TaskStep `json:"steps,omitempty"` CheckRunURL *string `json:"check_run_url,omitempty"` // Labels represents runner labels from the `runs-on:` key from a GitHub Actions workflow. - Labels []string `json:"labels,omitempty"` + Labels []string `json:"labels,omitempty"` + RunnerID *int64 `json:"runner_id,omitempty"` + RunnerName *string `json:"runner_name,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` + RunnerGroupName *string `json:"runner_group_name,omitempty"` } // Jobs represents a slice of repository action workflow job. diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_workflow_runs.go b/tools/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go similarity index 91% rename from tools/vendor/github.com/google/go-github/v39/github/actions_workflow_runs.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go index 3cd9df13..2c90956c 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/actions_workflow_runs.go +++ b/tools/vendor/github.com/google/go-github/v41/github/actions_workflow_runs.go @@ -74,8 +74,15 @@ type WorkflowRunEnvironment struct { // WorkflowRunBill specifies billable time for a specific environment in a workflow run. type WorkflowRunBill struct { - TotalMS *int64 `json:"total_ms,omitempty"` - Jobs *int `json:"jobs,omitempty"` + TotalMS *int64 `json:"total_ms,omitempty"` + Jobs *int `json:"jobs,omitempty"` + JobRuns []*WorkflowRunJobRun `json:"job_runs,omitempty"` +} + +// WorkflowRunJobRun represents a usage of individual jobs of a specific workflow run. +type WorkflowRunJobRun struct { + JobID *int `json:"job_id,omitempty"` + DurationMS *int64 `json:"duration_ms,omitempty"` } func (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) { @@ -204,6 +211,20 @@ func (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo str return parsedURL, newResponse(resp), err } +// DeleteWorkflowRun deletes a workflow run by ID. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run +func (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) { + u := fmt.Sprintf("repos/%v/%v/actions/runs/%v", owner, repo, runID) + + req, err := s.client.NewRequest("DELETE", u, nil) + if err != nil { + return nil, err + } + + return s.client.Do(ctx, req, nil) +} + // DeleteWorkflowRunLogs deletes all logs for a workflow run. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/actions/#delete-workflow-run-logs diff --git a/tools/vendor/github.com/google/go-github/v39/github/actions_workflows.go b/tools/vendor/github.com/google/go-github/v41/github/actions_workflows.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/actions_workflows.go rename to tools/vendor/github.com/google/go-github/v41/github/actions_workflows.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/activity.go b/tools/vendor/github.com/google/go-github/v41/github/activity.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/activity.go rename to tools/vendor/github.com/google/go-github/v41/github/activity.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/activity_events.go b/tools/vendor/github.com/google/go-github/v41/github/activity_events.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/activity_events.go rename to tools/vendor/github.com/google/go-github/v41/github/activity_events.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/activity_notifications.go b/tools/vendor/github.com/google/go-github/v41/github/activity_notifications.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/activity_notifications.go rename to tools/vendor/github.com/google/go-github/v41/github/activity_notifications.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/activity_star.go b/tools/vendor/github.com/google/go-github/v41/github/activity_star.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/activity_star.go rename to tools/vendor/github.com/google/go-github/v41/github/activity_star.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/activity_watching.go b/tools/vendor/github.com/google/go-github/v41/github/activity_watching.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/activity_watching.go rename to tools/vendor/github.com/google/go-github/v41/github/activity_watching.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/admin.go b/tools/vendor/github.com/google/go-github/v41/github/admin.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/admin.go rename to tools/vendor/github.com/google/go-github/v41/github/admin.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/admin_orgs.go b/tools/vendor/github.com/google/go-github/v41/github/admin_orgs.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/admin_orgs.go rename to tools/vendor/github.com/google/go-github/v41/github/admin_orgs.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/admin_stats.go b/tools/vendor/github.com/google/go-github/v41/github/admin_stats.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/admin_stats.go rename to tools/vendor/github.com/google/go-github/v41/github/admin_stats.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/admin_users.go b/tools/vendor/github.com/google/go-github/v41/github/admin_users.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/admin_users.go rename to tools/vendor/github.com/google/go-github/v41/github/admin_users.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/apps.go b/tools/vendor/github.com/google/go-github/v41/github/apps.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/apps.go rename to tools/vendor/github.com/google/go-github/v41/github/apps.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/apps_hooks.go b/tools/vendor/github.com/google/go-github/v41/github/apps_hooks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/apps_hooks.go rename to tools/vendor/github.com/google/go-github/v41/github/apps_hooks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/apps_installation.go b/tools/vendor/github.com/google/go-github/v41/github/apps_installation.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/apps_installation.go rename to tools/vendor/github.com/google/go-github/v41/github/apps_installation.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/apps_manifest.go b/tools/vendor/github.com/google/go-github/v41/github/apps_manifest.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/apps_manifest.go rename to tools/vendor/github.com/google/go-github/v41/github/apps_manifest.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/apps_marketplace.go b/tools/vendor/github.com/google/go-github/v41/github/apps_marketplace.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/apps_marketplace.go rename to tools/vendor/github.com/google/go-github/v41/github/apps_marketplace.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/authorizations.go b/tools/vendor/github.com/google/go-github/v41/github/authorizations.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/authorizations.go rename to tools/vendor/github.com/google/go-github/v41/github/authorizations.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/billing.go b/tools/vendor/github.com/google/go-github/v41/github/billing.go similarity index 68% rename from tools/vendor/github.com/google/go-github/v39/github/billing.go rename to tools/vendor/github.com/google/go-github/v41/github/billing.go index fa0e034d..12a79fa6 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/billing.go +++ b/tools/vendor/github.com/google/go-github/v41/github/billing.go @@ -39,9 +39,28 @@ type PackageBilling struct { // StorageBilling represents a GitHub Storage billing. type StorageBilling struct { - DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` - EstimatedPaidStorageForMonth int `json:"estimated_paid_storage_for_month"` - EstimatedStorageForMonth int `json:"estimated_storage_for_month"` + DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` + EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"` + EstimatedStorageForMonth int `json:"estimated_storage_for_month"` +} + +// ActiveCommitters represents the total active committers across all repositories in an Organization. +type ActiveCommitters struct { + TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers"` + Repositories []*RepositoryActiveCommitters `json:"repositories,omitempty"` +} + +// RepositoryActiveCommitters represents active committers on each repository. +type RepositoryActiveCommitters struct { + Name *string `json:"name,omitempty"` + AdvancedSecurityCommitters *int `json:"advanced_security_committers,omitempty"` + AdvancedSecurityCommittersBreakdown []*AdvancedSecurityCommittersBreakdown `json:"advanced_security_committers_breakdown,omitempty"` +} + +// AdvancedSecurityCommittersBreakdown represents the user activity breakdown for ActiveCommitters. +type AdvancedSecurityCommittersBreakdown struct { + UserLogin *string `json:"user_login,omitempty"` + LastPushedDate *string `json:"last_pushed_date,omitempty"` } // GetActionsBillingOrg returns the summary of the free and paid GitHub Actions minutes used for an Org. @@ -53,8 +72,13 @@ func (s *BillingService) GetActionsBillingOrg(ctx context.Context, org string) ( if err != nil { return nil, nil, err } + actionsOrgBilling := new(ActionBilling) resp, err := s.client.Do(ctx, req, actionsOrgBilling) + if err != nil { + return nil, resp, err + } + return actionsOrgBilling, resp, err } @@ -67,8 +91,13 @@ func (s *BillingService) GetPackagesBillingOrg(ctx context.Context, org string) if err != nil { return nil, nil, err } + packagesOrgBilling := new(PackageBilling) resp, err := s.client.Do(ctx, req, packagesOrgBilling) + if err != nil { + return nil, resp, err + } + return packagesOrgBilling, resp, err } @@ -82,11 +111,35 @@ func (s *BillingService) GetStorageBillingOrg(ctx context.Context, org string) ( if err != nil { return nil, nil, err } + storageOrgBilling := new(StorageBilling) resp, err := s.client.Do(ctx, req, storageOrgBilling) + if err != nil { + return nil, resp, err + } + return storageOrgBilling, resp, err } +// GetAdvancedSecurityActiveCommittersOrg returns the GitHub Advanced Security active committers for an organization per repository. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-advanced-security-active-committers-for-an-organization +func (s *BillingService) GetAdvancedSecurityActiveCommittersOrg(ctx context.Context, org string) (*ActiveCommitters, *Response, error) { + u := fmt.Sprintf("orgs/%v/settings/billing/advanced-security", org) + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return nil, nil, err + } + + activeOrgCommitters := new(ActiveCommitters) + resp, err := s.client.Do(ctx, req, activeOrgCommitters) + if err != nil { + return nil, resp, err + } + + return activeOrgCommitters, resp, err +} + // GetActionsBillingUser returns the summary of the free and paid GitHub Actions minutes used for a user. // // GitHub API docs: https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-a-user @@ -96,8 +149,13 @@ func (s *BillingService) GetActionsBillingUser(ctx context.Context, user string) if err != nil { return nil, nil, err } + actionsUserBilling := new(ActionBilling) resp, err := s.client.Do(ctx, req, actionsUserBilling) + if err != nil { + return nil, resp, err + } + return actionsUserBilling, resp, err } @@ -110,8 +168,13 @@ func (s *BillingService) GetPackagesBillingUser(ctx context.Context, user string if err != nil { return nil, nil, err } + packagesUserBilling := new(PackageBilling) resp, err := s.client.Do(ctx, req, packagesUserBilling) + if err != nil { + return nil, resp, err + } + return packagesUserBilling, resp, err } @@ -125,7 +188,12 @@ func (s *BillingService) GetStorageBillingUser(ctx context.Context, user string) if err != nil { return nil, nil, err } + storageUserBilling := new(StorageBilling) resp, err := s.client.Do(ctx, req, storageUserBilling) + if err != nil { + return nil, resp, err + } + return storageUserBilling, resp, err } diff --git a/tools/vendor/github.com/google/go-github/v39/github/checks.go b/tools/vendor/github.com/google/go-github/v41/github/checks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/checks.go rename to tools/vendor/github.com/google/go-github/v41/github/checks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/code-scanning.go b/tools/vendor/github.com/google/go-github/v41/github/code-scanning.go similarity index 79% rename from tools/vendor/github.com/google/go-github/v39/github/code-scanning.go rename to tools/vendor/github.com/google/go-github/v41/github/code-scanning.go index 50264a0c..4508c339 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/code-scanning.go +++ b/tools/vendor/github.com/google/go-github/v41/github/code-scanning.go @@ -119,6 +119,26 @@ type AlertListOptions struct { ListOptions } +// SarifAnalysis specifies the results of a code scanning job. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +type SarifAnalysis struct { + CommitSHA *string `json:"commit_sha,omitempty"` + Ref *string `json:"ref,omitempty"` + Sarif *string `json:"sarif,omitempty"` + CheckoutURI *string `json:"checkout_uri,omitempty"` + StartedAt *Timestamp `json:"started_at,omitempty"` + ToolName *string `json:"tool_name,omitempty"` +} + +// SarifID identifies a sarif analysis upload. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +type SarifID struct { + ID *string `json:"id,omitempty"` + URL *string `json:"url,omitempty"` +} + // ListAlertsForRepo lists code scanning alerts for a repository. // // Lists all open code scanning alerts for the default branch (usually master) and protected branches in a repository. @@ -171,3 +191,27 @@ func (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, return a, resp, nil } + +// UploadSarif uploads the result of code scanning job to GitHub. +// +// For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string. +// You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events +// write permission to use this endpoint. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/code-scanning#upload-an-analysis-as-sarif-data +func (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/code-scanning/sarifs", owner, repo) + + req, err := s.client.NewRequest("POST", u, sarif) + if err != nil { + return nil, nil, err + } + + sarifID := new(SarifID) + resp, err := s.client.Do(ctx, req, sarifID) + if err != nil { + return nil, resp, err + } + + return sarifID, resp, nil +} diff --git a/tools/vendor/github.com/google/go-github/v39/github/doc.go b/tools/vendor/github.com/google/go-github/v41/github/doc.go similarity index 99% rename from tools/vendor/github.com/google/go-github/v39/github/doc.go rename to tools/vendor/github.com/google/go-github/v41/github/doc.go index 87eda1de..d67e2869 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/doc.go +++ b/tools/vendor/github.com/google/go-github/v41/github/doc.go @@ -8,7 +8,7 @@ Package github provides a client for using the GitHub API. Usage: - import "github.com/google/go-github/v39/github" // with go modules enabled (GO111MODULE=on or outside GOPATH) + import "github.com/google/go-github/v41/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 diff --git a/tools/vendor/github.com/google/go-github/v39/github/enterprise.go b/tools/vendor/github.com/google/go-github/v41/github/enterprise.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/enterprise.go rename to tools/vendor/github.com/google/go-github/v41/github/enterprise.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/enterprise_actions_runners.go b/tools/vendor/github.com/google/go-github/v41/github/enterprise_actions_runners.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/enterprise_actions_runners.go rename to tools/vendor/github.com/google/go-github/v41/github/enterprise_actions_runners.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/enterprise_audit_log.go b/tools/vendor/github.com/google/go-github/v41/github/enterprise_audit_log.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/enterprise_audit_log.go rename to tools/vendor/github.com/google/go-github/v41/github/enterprise_audit_log.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/event.go b/tools/vendor/github.com/google/go-github/v41/github/event.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/event.go rename to tools/vendor/github.com/google/go-github/v41/github/event.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/event_types.go b/tools/vendor/github.com/google/go-github/v41/github/event_types.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/event_types.go rename to tools/vendor/github.com/google/go-github/v41/github/event_types.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/gists.go b/tools/vendor/github.com/google/go-github/v41/github/gists.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/gists.go rename to tools/vendor/github.com/google/go-github/v41/github/gists.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/gists_comments.go b/tools/vendor/github.com/google/go-github/v41/github/gists_comments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/gists_comments.go rename to tools/vendor/github.com/google/go-github/v41/github/gists_comments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/git.go b/tools/vendor/github.com/google/go-github/v41/github/git.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/git.go rename to tools/vendor/github.com/google/go-github/v41/github/git.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/git_blobs.go b/tools/vendor/github.com/google/go-github/v41/github/git_blobs.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/git_blobs.go rename to tools/vendor/github.com/google/go-github/v41/github/git_blobs.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/git_commits.go b/tools/vendor/github.com/google/go-github/v41/github/git_commits.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/git_commits.go rename to tools/vendor/github.com/google/go-github/v41/github/git_commits.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/git_refs.go b/tools/vendor/github.com/google/go-github/v41/github/git_refs.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/git_refs.go rename to tools/vendor/github.com/google/go-github/v41/github/git_refs.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/git_tags.go b/tools/vendor/github.com/google/go-github/v41/github/git_tags.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/git_tags.go rename to tools/vendor/github.com/google/go-github/v41/github/git_tags.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/git_trees.go b/tools/vendor/github.com/google/go-github/v41/github/git_trees.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/git_trees.go rename to tools/vendor/github.com/google/go-github/v41/github/git_trees.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/github-accessors.go b/tools/vendor/github.com/google/go-github/v41/github/github-accessors.go similarity index 98% rename from tools/vendor/github.com/google/go-github/v39/github/github-accessors.go rename to tools/vendor/github.com/google/go-github/v41/github/github-accessors.go index 12dc2ca6..b6a846ef 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/github-accessors.go +++ b/tools/vendor/github.com/google/go-github/v41/github/github-accessors.go @@ -148,6 +148,30 @@ func (a *AdminStats) GetUsers() *UserStats { return a.Users } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (a *AdvancedSecurity) GetStatus() string { + if a == nil || a.Status == nil { + return "" + } + return *a.Status +} + +// GetLastPushedDate returns the LastPushedDate field if it's non-nil, zero value otherwise. +func (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string { + if a == nil || a.LastPushedDate == nil { + return "" + } + return *a.LastPushedDate +} + +// GetUserLogin returns the UserLogin field if it's non-nil, zero value otherwise. +func (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string { + if a == nil || a.UserLogin == nil { + return "" + } + return *a.UserLogin +} + // GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise. func (a *Alert) GetClosedAt() Timestamp { if a == nil || a.ClosedAt == nil { @@ -869,9 +893,9 @@ func (a *AuditEntry) GetRepositoryPublic() bool { } // GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerGroupID() string { +func (a *AuditEntry) GetRunnerGroupID() int64 { if a == nil || a.RunnerGroupID == nil { - return "" + return 0 } return *a.RunnerGroupID } @@ -885,9 +909,9 @@ func (a *AuditEntry) GetRunnerGroupName() string { } // GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. -func (a *AuditEntry) GetRunnerID() string { +func (a *AuditEntry) GetRunnerID() int64 { if a == nil || a.RunnerID == nil { - return "" + return 0 } return *a.RunnerID } @@ -13676,6 +13700,14 @@ func (r *Repository) GetReleasesURL() string { return *r.ReleasesURL } +// GetSecurityAndAnalysis returns the SecurityAndAnalysis field. +func (r *Repository) GetSecurityAndAnalysis() *SecurityAndAnalysis { + if r == nil { + return nil + } + return r.SecurityAndAnalysis +} + // GetSize returns the Size field if it's non-nil, zero value otherwise. func (r *Repository) GetSize() int { if r == nil || r.Size == nil { @@ -13836,6 +13868,22 @@ func (r *Repository) GetWatchersCount() int { return *r.WatchersCount } +// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field if it's non-nil, zero value otherwise. +func (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int { + if r == nil || r.AdvancedSecurityCommitters == nil { + return 0 + } + return *r.AdvancedSecurityCommitters +} + +// GetName returns the Name field if it's non-nil, zero value otherwise. +func (r *RepositoryActiveCommitters) GetName() string { + if r == nil || r.Name == nil { + return "" + } + return *r.Name +} + // GetBody returns the Body field if it's non-nil, zero value otherwise. func (r *RepositoryComment) GetBody() string { if r == nil || r.Body == nil { @@ -15132,6 +15180,70 @@ func (r *RunnerLabels) GetType() string { return *r.Type } +// GetCheckoutURI returns the CheckoutURI field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetCheckoutURI() string { + if s == nil || s.CheckoutURI == nil { + return "" + } + return *s.CheckoutURI +} + +// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetCommitSHA() string { + if s == nil || s.CommitSHA == nil { + return "" + } + return *s.CommitSHA +} + +// GetRef returns the Ref field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetRef() string { + if s == nil || s.Ref == nil { + return "" + } + return *s.Ref +} + +// GetSarif returns the Sarif field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetSarif() string { + if s == nil || s.Sarif == nil { + return "" + } + return *s.Sarif +} + +// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetStartedAt() Timestamp { + if s == nil || s.StartedAt == nil { + return Timestamp{} + } + return *s.StartedAt +} + +// GetToolName returns the ToolName field if it's non-nil, zero value otherwise. +func (s *SarifAnalysis) GetToolName() string { + if s == nil || s.ToolName == nil { + return "" + } + return *s.ToolName +} + +// GetID returns the ID field if it's non-nil, zero value otherwise. +func (s *SarifID) GetID() string { + if s == nil || s.ID == nil { + return "" + } + return *s.ID +} + +// GetURL returns the URL field if it's non-nil, zero value otherwise. +func (s *SarifID) GetURL() string { + if s == nil || s.URL == nil { + return "" + } + return *s.URL +} + // GetActive returns the Active field if it's non-nil, zero value otherwise. func (s *SCIMUserAttributes) GetActive() bool { if s == nil || s.Active == nil { @@ -15180,6 +15292,30 @@ func (s *SCIMUserName) GetFormatted() string { return *s.Formatted } +// GetStatus returns the Status field if it's non-nil, zero value otherwise. +func (s *SecretScanning) GetStatus() string { + if s == nil || s.Status == nil { + return "" + } + return *s.Status +} + +// GetAdvancedSecurity returns the AdvancedSecurity field. +func (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity { + if s == nil { + return nil + } + return s.AdvancedSecurity +} + +// GetSecretScanning returns the SecretScanning field. +func (s *SecurityAndAnalysis) GetSecretScanning() *SecretScanning { + if s == nil { + return nil + } + return s.SecretScanning +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (s *SelectedReposList) GetTotalCount() int { if s == nil || s.TotalCount == nil { @@ -16332,6 +16468,30 @@ func (t *Timeline) GetAssignee() *User { return t.Assignee } +// GetAssigner returns the Assigner field. +func (t *Timeline) GetAssigner() *User { + if t == nil { + return nil + } + return t.Assigner +} + +// GetAuthor returns the Author field. +func (t *Timeline) GetAuthor() *CommitAuthor { + if t == nil { + return nil + } + return t.Author +} + +// GetBody returns the Body field if it's non-nil, zero value otherwise. +func (t *Timeline) GetBody() string { + if t == nil || t.Body == nil { + return "" + } + return *t.Body +} + // GetCommitID returns the CommitID field if it's non-nil, zero value otherwise. func (t *Timeline) GetCommitID() string { if t == nil || t.CommitID == nil { @@ -16340,6 +16500,14 @@ func (t *Timeline) GetCommitID() string { return *t.CommitID } +// GetCommitter returns the Committer field. +func (t *Timeline) GetCommitter() *CommitAuthor { + if t == nil { + return nil + } + return t.Committer +} + // GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise. func (t *Timeline) GetCommitURL() string { if t == nil || t.CommitURL == nil { @@ -16380,6 +16548,14 @@ func (t *Timeline) GetLabel() *Label { return t.Label } +// GetMessage returns the Message field if it's non-nil, zero value otherwise. +func (t *Timeline) GetMessage() string { + if t == nil || t.Message == nil { + return "" + } + return *t.Message +} + // GetMilestone returns the Milestone field. func (t *Timeline) GetMilestone() *Milestone { if t == nil { @@ -16404,6 +16580,30 @@ func (t *Timeline) GetRename() *Rename { return t.Rename } +// GetRequester returns the Requester field. +func (t *Timeline) GetRequester() *User { + if t == nil { + return nil + } + return t.Requester +} + +// GetReviewer returns the Reviewer field. +func (t *Timeline) GetReviewer() *User { + if t == nil { + return nil + } + return t.Reviewer +} + +// GetSHA returns the SHA field if it's non-nil, zero value otherwise. +func (t *Timeline) GetSHA() string { + if t == nil || t.SHA == nil { + return "" + } + return *t.SHA +} + // GetSource returns the Source field. func (t *Timeline) GetSource() *Source { if t == nil { @@ -16420,6 +16620,14 @@ func (t *Timeline) GetState() string { return *t.State } +// GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise. +func (t *Timeline) GetSubmittedAt() time.Time { + if t == nil || t.SubmittedAt == nil { + return time.Time{} + } + return *t.SubmittedAt +} + // GetURL returns the URL field if it's non-nil, zero value otherwise. func (t *Timeline) GetURL() string { if t == nil || t.URL == nil { @@ -16428,6 +16636,14 @@ func (t *Timeline) GetURL() string { return *t.URL } +// GetUser returns the User field. +func (t *Timeline) GetUser() *User { + if t == nil { + return nil + } + return t.User +} + // GetGUID returns the GUID field if it's non-nil, zero value otherwise. func (t *Tool) GetGUID() string { if t == nil || t.GUID == nil { @@ -18068,6 +18284,38 @@ func (w *WorkflowJob) GetRunID() int64 { return *w.RunID } +// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerGroupID() int64 { + if w == nil || w.RunnerGroupID == nil { + return 0 + } + return *w.RunnerGroupID +} + +// GetRunnerGroupName returns the RunnerGroupName field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerGroupName() string { + if w == nil || w.RunnerGroupName == nil { + return "" + } + return *w.RunnerGroupName +} + +// GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerID() int64 { + if w == nil || w.RunnerID == nil { + return 0 + } + return *w.RunnerID +} + +// GetRunnerName returns the RunnerName field if it's non-nil, zero value otherwise. +func (w *WorkflowJob) GetRunnerName() string { + if w == nil || w.RunnerName == nil { + return "" + } + return *w.RunnerName +} + // GetRunURL returns the RunURL field if it's non-nil, zero value otherwise. func (w *WorkflowJob) GetRunURL() string { if w == nil || w.RunURL == nil { @@ -18452,6 +18700,22 @@ func (w *WorkflowRunEvent) GetWorkflowRun() *WorkflowRun { return w.WorkflowRun } +// GetDurationMS returns the DurationMS field if it's non-nil, zero value otherwise. +func (w *WorkflowRunJobRun) GetDurationMS() int64 { + if w == nil || w.DurationMS == nil { + return 0 + } + return *w.DurationMS +} + +// GetJobID returns the JobID field if it's non-nil, zero value otherwise. +func (w *WorkflowRunJobRun) GetJobID() int { + if w == nil || w.JobID == nil { + return 0 + } + return *w.JobID +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (w *WorkflowRuns) GetTotalCount() int { if w == nil || w.TotalCount == nil { diff --git a/tools/vendor/github.com/google/go-github/v39/github/github.go b/tools/vendor/github.com/google/go-github/v41/github/github.go similarity index 96% rename from tools/vendor/github.com/google/go-github/v39/github/github.go rename to tools/vendor/github.com/google/go-github/v41/github/github.go index d4d7a54a..a7afd834 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/github.go +++ b/tools/vendor/github.com/google/go-github/v41/github/github.go @@ -48,6 +48,21 @@ const ( mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json" // Media Type values to access preview APIs + // These media types will be added to the API request as headers + // and used to enable particular features on GitHub API that are still in preview. + // After some time, specific media types will be promoted (to a "stable" state). + // From then on, the preview headers are not required anymore to activate the additional + // feature on GitHub.com's API. However, this API header might still be needed for users + // to run a GitHub Enterprise Server on-premise. + // It's not uncommon for GitHub Enterprise Server customers to run older versions which + // would probably rely on the preview headers for some time. + // While the header promotion is going out for GitHub.com, it may be some time before it + // even arrives in GitHub Enterprise Server. + // We keep those preview headers around to avoid breaking older GitHub Enterprise Server + // versions. Additionally, non-functional (preview) headers don't create any side effects + // on GitHub Cloud version. + // + // 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" @@ -462,6 +477,10 @@ type Response struct { // Set ListCursorOptions.Cursor to this value when calling the endpoint again. Cursor string + // For APIs that support before/after pagination, such as OrganizationsService.AuditLog. + Before string + After string + // Explicitly specify the Rate type so Rate's String() receiver doesn't // propagate to Response. Rate Rate @@ -517,18 +536,28 @@ func (r *Response) populatePageValues() { } page := q.Get("page") - if page == "" { + since := q.Get("since") + before := q.Get("before") + after := q.Get("after") + + if page == "" && before == "" && after == "" && since == "" { continue } + if since != "" { + page = since + } + for _, segment := range segments[1:] { switch strings.TrimSpace(segment) { case `rel="next"`: if r.NextPage, err = strconv.Atoi(page); err != nil { r.NextPageToken = page } + r.After = after case `rel="prev"`: r.PrevPage, _ = strconv.Atoi(page) + r.Before = before case `rel="first"`: r.FirstPage, _ = strconv.Atoi(page) case `rel="last"`: diff --git a/tools/vendor/github.com/google/go-github/v39/github/gitignore.go b/tools/vendor/github.com/google/go-github/v41/github/gitignore.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/gitignore.go rename to tools/vendor/github.com/google/go-github/v41/github/gitignore.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/interactions.go b/tools/vendor/github.com/google/go-github/v41/github/interactions.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/interactions.go rename to tools/vendor/github.com/google/go-github/v41/github/interactions.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/interactions_orgs.go b/tools/vendor/github.com/google/go-github/v41/github/interactions_orgs.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/interactions_orgs.go rename to tools/vendor/github.com/google/go-github/v41/github/interactions_orgs.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/interactions_repos.go b/tools/vendor/github.com/google/go-github/v41/github/interactions_repos.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/interactions_repos.go rename to tools/vendor/github.com/google/go-github/v41/github/interactions_repos.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issue_import.go b/tools/vendor/github.com/google/go-github/v41/github/issue_import.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/issue_import.go rename to tools/vendor/github.com/google/go-github/v41/github/issue_import.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues.go b/tools/vendor/github.com/google/go-github/v41/github/issues.go similarity index 94% rename from tools/vendor/github.com/google/go-github/v39/github/issues.go rename to tools/vendor/github.com/google/go-github/v41/github/issues.go index 46aff295..f35f2b56 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/issues.go +++ b/tools/vendor/github.com/google/go-github/v41/github/issues.go @@ -299,6 +299,29 @@ func (s *IssuesService) Edit(ctx context.Context, owner string, repo string, num return i, resp, nil } +// Remove a milestone from an issue. +// +// This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it. +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/#update-an-issue +func (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/issues/%v", owner, repo, issueNumber) + req, err := s.client.NewRequest("PATCH", u, &struct { + Milestone *Milestone `json:"milestone"` + }{}) + if err != nil { + return nil, nil, err + } + + i := new(Issue) + resp, err := s.client.Do(ctx, req, i) + if err != nil { + return nil, resp, err + } + + return i, resp, nil +} + // LockIssueOptions specifies the optional parameters to the // IssuesService.Lock method. type LockIssueOptions struct { diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues_assignees.go b/tools/vendor/github.com/google/go-github/v41/github/issues_assignees.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/issues_assignees.go rename to tools/vendor/github.com/google/go-github/v41/github/issues_assignees.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues_comments.go b/tools/vendor/github.com/google/go-github/v41/github/issues_comments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/issues_comments.go rename to tools/vendor/github.com/google/go-github/v41/github/issues_comments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues_events.go b/tools/vendor/github.com/google/go-github/v41/github/issues_events.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/issues_events.go rename to tools/vendor/github.com/google/go-github/v41/github/issues_events.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues_labels.go b/tools/vendor/github.com/google/go-github/v41/github/issues_labels.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/issues_labels.go rename to tools/vendor/github.com/google/go-github/v41/github/issues_labels.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues_milestones.go b/tools/vendor/github.com/google/go-github/v41/github/issues_milestones.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/issues_milestones.go rename to tools/vendor/github.com/google/go-github/v41/github/issues_milestones.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/issues_timeline.go b/tools/vendor/github.com/google/go-github/v41/github/issues_timeline.go similarity index 85% rename from tools/vendor/github.com/google/go-github/v39/github/issues_timeline.go rename to tools/vendor/github.com/google/go-github/v41/github/issues_timeline.go index 1fd13b12..845e3f76 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/issues_timeline.go +++ b/tools/vendor/github.com/google/go-github/v41/github/issues_timeline.go @@ -15,7 +15,7 @@ import ( // Timeline represents an event that occurred around an Issue or Pull Request. // // It is similar to an IssueEvent but may contain more information. -// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/issues/timeline/ +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/events/issue-event-types type Timeline struct { ID *int64 `json:"id,omitempty"` URL *string `json:"url,omitempty"` @@ -24,6 +24,18 @@ type Timeline struct { // The User object that generated the event. Actor *User `json:"actor,omitempty"` + // The person who commented on the issue. + User *User `json:"user,omitempty"` + + // The person who authored the commit. + Author *CommitAuthor `json:"author,omitempty"` + // The person who committed the commit on behalf of the author. + Committer *CommitAuthor `json:"committer,omitempty"` + // The SHA of the commit in the pull request. + SHA *string `json:"sha,omitempty"` + // The commit message. + Message *string `json:"message,omitempty"` + // Event identifies the actual type of Event that occurred. Possible values // are: // @@ -111,6 +123,8 @@ type Timeline struct { // The User object which was assigned to (or unassigned from) this Issue or // Pull Request. Only provided for 'assigned' and 'unassigned' events. Assignee *User `json:"assignee,omitempty"` + Assigner *User `json:"assigner,omitempty"` + // The Milestone object including a 'title' attribute. // Only provided for 'milestoned' and 'demilestoned' events. Milestone *Milestone `json:"milestone,omitempty"` @@ -125,6 +139,15 @@ type Timeline struct { // 'changes_requested' or 'approved'. // Only provided for 'reviewed' events. State *string `json:"state,omitempty"` + + // The person requested to review the pull request. + Reviewer *User `json:"requested_reviewer,omitempty"` + // The person who requested a review. + Requester *User `json:"review_requester,omitempty"` + + // The review summary text. + Body *string `json:"body,omitempty"` + SubmittedAt *time.Time `json:"submitted_at,omitempty"` } // Source represents a reference's source. diff --git a/tools/vendor/github.com/google/go-github/v39/github/licenses.go b/tools/vendor/github.com/google/go-github/v41/github/licenses.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/licenses.go rename to tools/vendor/github.com/google/go-github/v41/github/licenses.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/messages.go b/tools/vendor/github.com/google/go-github/v41/github/messages.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/messages.go rename to tools/vendor/github.com/google/go-github/v41/github/messages.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/migrations.go b/tools/vendor/github.com/google/go-github/v41/github/migrations.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/migrations.go rename to tools/vendor/github.com/google/go-github/v41/github/migrations.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/migrations_source_import.go b/tools/vendor/github.com/google/go-github/v41/github/migrations_source_import.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/migrations_source_import.go rename to tools/vendor/github.com/google/go-github/v41/github/migrations_source_import.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/migrations_user.go b/tools/vendor/github.com/google/go-github/v41/github/migrations_user.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/migrations_user.go rename to tools/vendor/github.com/google/go-github/v41/github/migrations_user.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/misc.go b/tools/vendor/github.com/google/go-github/v41/github/misc.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/misc.go rename to tools/vendor/github.com/google/go-github/v41/github/misc.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs.go b/tools/vendor/github.com/google/go-github/v41/github/orgs.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_actions_allowed.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_actions_allowed.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_actions_allowed.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_actions_allowed.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_actions_permissions.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_actions_permissions.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_actions_permissions.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_actions_permissions.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_audit_log.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_audit_log.go similarity index 92% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_audit_log.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_audit_log.go index 4b98ba69..ade57f54 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/orgs_audit_log.go +++ b/tools/vendor/github.com/google/go-github/v41/github/orgs_audit_log.go @@ -12,9 +12,9 @@ import ( // GetAuditLogOptions sets up optional parameters to query audit-log endpoint. type GetAuditLogOptions struct { - Phrase *string `json:"phrase,omitempty"` // A search phrase. (Optional.) - Include *string `json:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.) - Order *string `json:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.) + Phrase *string `url:"phrase,omitempty"` // A search phrase. (Optional.) + Include *string `url:"include,omitempty"` // Event type includes. Can be one of "web", "git", "all". Default: "web". (Optional.) + Order *string `url:"order,omitempty"` // The order of audit log events. Can be one of "asc" or "desc". Default: "desc". (Optional.) ListCursorOptions } @@ -70,9 +70,9 @@ type AuditEntry struct { Repo *string `json:"repo,omitempty"` Repository *string `json:"repository,omitempty"` RepositoryPublic *bool `json:"repository_public,omitempty"` - RunnerGroupID *string `json:"runner_group_id,omitempty"` + RunnerGroupID *int64 `json:"runner_group_id,omitempty"` RunnerGroupName *string `json:"runner_group_name,omitempty"` - RunnerID *string `json:"runner_id,omitempty"` + RunnerID *int64 `json:"runner_id,omitempty"` RunnerLabels []string `json:"runner_labels,omitempty"` RunnerName *string `json:"runner_name,omitempty"` SecretsPassed []string `json:"secrets_passed,omitempty"` diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_hooks.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_hooks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_hooks.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_hooks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_hooks_deliveries.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_hooks_deliveries.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_hooks_deliveries.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_hooks_deliveries.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_members.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_members.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_members.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_members.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_outside_collaborators.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_outside_collaborators.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_outside_collaborators.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_outside_collaborators.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_packages.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_packages.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_packages.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_packages.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_projects.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_projects.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_projects.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_projects.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/orgs_users_blocking.go b/tools/vendor/github.com/google/go-github/v41/github/orgs_users_blocking.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/orgs_users_blocking.go rename to tools/vendor/github.com/google/go-github/v41/github/orgs_users_blocking.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/packages.go b/tools/vendor/github.com/google/go-github/v41/github/packages.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/packages.go rename to tools/vendor/github.com/google/go-github/v41/github/packages.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/projects.go b/tools/vendor/github.com/google/go-github/v41/github/projects.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/projects.go rename to tools/vendor/github.com/google/go-github/v41/github/projects.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/pulls.go b/tools/vendor/github.com/google/go-github/v41/github/pulls.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/pulls.go rename to tools/vendor/github.com/google/go-github/v41/github/pulls.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/pulls_comments.go b/tools/vendor/github.com/google/go-github/v41/github/pulls_comments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/pulls_comments.go rename to tools/vendor/github.com/google/go-github/v41/github/pulls_comments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/pulls_reviewers.go b/tools/vendor/github.com/google/go-github/v41/github/pulls_reviewers.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/pulls_reviewers.go rename to tools/vendor/github.com/google/go-github/v41/github/pulls_reviewers.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/pulls_reviews.go b/tools/vendor/github.com/google/go-github/v41/github/pulls_reviews.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/pulls_reviews.go rename to tools/vendor/github.com/google/go-github/v41/github/pulls_reviews.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/reactions.go b/tools/vendor/github.com/google/go-github/v41/github/reactions.go similarity index 95% rename from tools/vendor/github.com/google/go-github/v39/github/reactions.go rename to tools/vendor/github.com/google/go-github/v41/github/reactions.go index 08387cb5..ecfcf2e9 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/reactions.go +++ b/tools/vendor/github.com/google/go-github/v41/github/reactions.go @@ -492,3 +492,29 @@ func (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Res return s.client.Do(ctx, req, nil) } + +// Create a reaction to a release. +// Note that a response with a Status: 200 OK means that you already +// added the reaction type to this release. +// The content should have one of the following values: "+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", or "eyes". +// +// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/reactions/#create-reaction-for-a-release +func (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/releases/%v/reactions", owner, repo, releaseID) + + body := &Reaction{Content: String(content)} + req, err := s.client.NewRequest("POST", u, body) + if err != nil { + return nil, nil, err + } + + req.Header.Set("Accept", mediaTypeReactionsPreview) + + m := &Reaction{} + resp, err := s.client.Do(ctx, req, m) + if err != nil { + return nil, resp, err + } + + return m, resp, nil +} diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos.go b/tools/vendor/github.com/google/go-github/v41/github/repos.go similarity index 96% rename from tools/vendor/github.com/google/go-github/v39/github/repos.go rename to tools/vendor/github.com/google/go-github/v41/github/repos.go index f6236b43..45c46180 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/repos.go +++ b/tools/vendor/github.com/google/go-github/v41/github/repos.go @@ -80,6 +80,9 @@ type Repository struct { LicenseTemplate *string `json:"license_template,omitempty"` GitignoreTemplate *string `json:"gitignore_template,omitempty"` + // Options for configuring Advanced Security and Secret Scanning + SecurityAndAnalysis *SecurityAndAnalysis `json:"security_and_analysis,omitempty"` + // Creating an organization repository. Required for non-owners. TeamID *int64 `json:"team_id,omitempty"` @@ -183,6 +186,39 @@ type RepositoryListOptions struct { ListOptions } +// SecurityAndAnalysis specifies the optional advanced security features +// that are enabled on a given repository. +type SecurityAndAnalysis struct { + AdvancedSecurity *AdvancedSecurity `json:"advanced_security,omitempty"` + SecretScanning *SecretScanning `json:"secret_scanning,omitempty"` +} + +func (s SecurityAndAnalysis) String() string { + return Stringify(s) +} + +// AdvancedSecurity specifies the state of advanced security on a repository. +// +// GitHub API docs: https://docs.github.com/en/github/getting-started-with-github/learning-about-github/about-github-advanced-security +type AdvancedSecurity struct { + Status *string `json:"status,omitempty"` +} + +func (a AdvancedSecurity) String() string { + return Stringify(a) +} + +// SecretScanning specifies the state of secret scanning on a repository. +// +// GitHub API docs: https://docs.github.com/en/code-security/secret-security/about-secret-scanning +type SecretScanning struct { + Status *string `json:"status,omitempty"` +} + +func (s SecretScanning) String() string { + return Stringify(s) +} + // List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // @@ -1037,6 +1073,34 @@ func (s *RepositoriesService) getBranchFromURL(ctx context.Context, u string, fo return resp, err } +// renameBranchRequest represents a request to rename a branch. +type renameBranchRequest struct { + NewName string `json:"new_name"` +} + +// RenameBranch renames a branch in a repository. +// +// To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission. +// To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission. +// +// GitHub API docs: https://docs.github.com/en/rest/reference/repos#rename-a-branch +func (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/branches/%v/rename", owner, repo, branch) + r := &renameBranchRequest{NewName: newName} + req, err := s.client.NewRequest("POST", u, r) + if err != nil { + return nil, nil, err + } + + b := new(Branch) + resp, err := s.client.Do(ctx, req, b) + if err != nil { + return nil, resp, err + } + + return b, resp, nil +} + // GetBranchProtection gets the protection of a given branch. // // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/repos/#get-branch-protection diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_autolinks.go b/tools/vendor/github.com/google/go-github/v41/github/repos_autolinks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_autolinks.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_autolinks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_collaborators.go b/tools/vendor/github.com/google/go-github/v41/github/repos_collaborators.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_collaborators.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_collaborators.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_comments.go b/tools/vendor/github.com/google/go-github/v41/github/repos_comments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_comments.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_comments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_commits.go b/tools/vendor/github.com/google/go-github/v41/github/repos_commits.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_commits.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_commits.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_community_health.go b/tools/vendor/github.com/google/go-github/v41/github/repos_community_health.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_community_health.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_community_health.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_contents.go b/tools/vendor/github.com/google/go-github/v41/github/repos_contents.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_contents.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_contents.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_deployments.go b/tools/vendor/github.com/google/go-github/v41/github/repos_deployments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_deployments.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_deployments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_environments.go b/tools/vendor/github.com/google/go-github/v41/github/repos_environments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_environments.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_environments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_forks.go b/tools/vendor/github.com/google/go-github/v41/github/repos_forks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_forks.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_forks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_hooks.go b/tools/vendor/github.com/google/go-github/v41/github/repos_hooks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_hooks.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_hooks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_hooks_deliveries.go b/tools/vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_hooks_deliveries.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_hooks_deliveries.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_invitations.go b/tools/vendor/github.com/google/go-github/v41/github/repos_invitations.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_invitations.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_invitations.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_keys.go b/tools/vendor/github.com/google/go-github/v41/github/repos_keys.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_keys.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_keys.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_merging.go b/tools/vendor/github.com/google/go-github/v41/github/repos_merging.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_merging.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_merging.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_pages.go b/tools/vendor/github.com/google/go-github/v41/github/repos_pages.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_pages.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_pages.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_prereceive_hooks.go b/tools/vendor/github.com/google/go-github/v41/github/repos_prereceive_hooks.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_prereceive_hooks.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_prereceive_hooks.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_projects.go b/tools/vendor/github.com/google/go-github/v41/github/repos_projects.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_projects.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_projects.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_releases.go b/tools/vendor/github.com/google/go-github/v41/github/repos_releases.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_releases.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_releases.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_stats.go b/tools/vendor/github.com/google/go-github/v41/github/repos_stats.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_stats.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_stats.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_statuses.go b/tools/vendor/github.com/google/go-github/v41/github/repos_statuses.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_statuses.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_statuses.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/repos_traffic.go b/tools/vendor/github.com/google/go-github/v41/github/repos_traffic.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/repos_traffic.go rename to tools/vendor/github.com/google/go-github/v41/github/repos_traffic.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/scim.go b/tools/vendor/github.com/google/go-github/v41/github/scim.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/scim.go rename to tools/vendor/github.com/google/go-github/v41/github/scim.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/search.go b/tools/vendor/github.com/google/go-github/v41/github/search.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/search.go rename to tools/vendor/github.com/google/go-github/v41/github/search.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/strings.go b/tools/vendor/github.com/google/go-github/v41/github/strings.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/strings.go rename to tools/vendor/github.com/google/go-github/v41/github/strings.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/teams.go b/tools/vendor/github.com/google/go-github/v41/github/teams.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/teams.go rename to tools/vendor/github.com/google/go-github/v41/github/teams.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/teams_discussion_comments.go b/tools/vendor/github.com/google/go-github/v41/github/teams_discussion_comments.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/teams_discussion_comments.go rename to tools/vendor/github.com/google/go-github/v41/github/teams_discussion_comments.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/teams_discussions.go b/tools/vendor/github.com/google/go-github/v41/github/teams_discussions.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/teams_discussions.go rename to tools/vendor/github.com/google/go-github/v41/github/teams_discussions.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/teams_members.go b/tools/vendor/github.com/google/go-github/v41/github/teams_members.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/teams_members.go rename to tools/vendor/github.com/google/go-github/v41/github/teams_members.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/timestamp.go b/tools/vendor/github.com/google/go-github/v41/github/timestamp.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/timestamp.go rename to tools/vendor/github.com/google/go-github/v41/github/timestamp.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users.go b/tools/vendor/github.com/google/go-github/v41/github/users.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users.go rename to tools/vendor/github.com/google/go-github/v41/github/users.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_administration.go b/tools/vendor/github.com/google/go-github/v41/github/users_administration.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_administration.go rename to tools/vendor/github.com/google/go-github/v41/github/users_administration.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_blocking.go b/tools/vendor/github.com/google/go-github/v41/github/users_blocking.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_blocking.go rename to tools/vendor/github.com/google/go-github/v41/github/users_blocking.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_emails.go b/tools/vendor/github.com/google/go-github/v41/github/users_emails.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_emails.go rename to tools/vendor/github.com/google/go-github/v41/github/users_emails.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_followers.go b/tools/vendor/github.com/google/go-github/v41/github/users_followers.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_followers.go rename to tools/vendor/github.com/google/go-github/v41/github/users_followers.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_gpg_keys.go b/tools/vendor/github.com/google/go-github/v41/github/users_gpg_keys.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_gpg_keys.go rename to tools/vendor/github.com/google/go-github/v41/github/users_gpg_keys.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_keys.go b/tools/vendor/github.com/google/go-github/v41/github/users_keys.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_keys.go rename to tools/vendor/github.com/google/go-github/v41/github/users_keys.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_packages.go b/tools/vendor/github.com/google/go-github/v41/github/users_packages.go similarity index 99% rename from tools/vendor/github.com/google/go-github/v39/github/users_packages.go rename to tools/vendor/github.com/google/go-github/v41/github/users_packages.go index d0684406..4308b16e 100644 --- a/tools/vendor/github.com/google/go-github/v39/github/users_packages.go +++ b/tools/vendor/github.com/google/go-github/v41/github/users_packages.go @@ -18,7 +18,7 @@ import ( func (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) { var u string if user != "" { - u = fmt.Sprintf("user/%v/packages", user) + u = fmt.Sprintf("users/%v/packages", user) } else { u = "user/packages" } diff --git a/tools/vendor/github.com/google/go-github/v39/github/users_projects.go b/tools/vendor/github.com/google/go-github/v41/github/users_projects.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/users_projects.go rename to tools/vendor/github.com/google/go-github/v41/github/users_projects.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/with_appengine.go b/tools/vendor/github.com/google/go-github/v41/github/with_appengine.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/with_appengine.go rename to tools/vendor/github.com/google/go-github/v41/github/with_appengine.go diff --git a/tools/vendor/github.com/google/go-github/v39/github/without_appengine.go b/tools/vendor/github.com/google/go-github/v41/github/without_appengine.go similarity index 100% rename from tools/vendor/github.com/google/go-github/v39/github/without_appengine.go rename to tools/vendor/github.com/google/go-github/v41/github/without_appengine.go diff --git a/tools/vendor/github.com/goreleaser/goreleaser/Dockerfile b/tools/vendor/github.com/goreleaser/goreleaser/Dockerfile index fab44fe3..ea70cc61 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/Dockerfile +++ b/tools/vendor/github.com/goreleaser/goreleaser/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.17.5-alpine +FROM golang:1.17.6-alpine RUN apk add --no-cache bash \ curl \ diff --git a/tools/vendor/github.com/goreleaser/goreleaser/USERS.md b/tools/vendor/github.com/goreleaser/goreleaser/USERS.md index 6cc1945a..9d21676e 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/USERS.md +++ b/tools/vendor/github.com/goreleaser/goreleaser/USERS.md @@ -29,12 +29,14 @@ Here's a running list of some organizations using GoReleaser[^1]: 1. [Numary](https://numary.com) 1. [Planetscale](https://planetscale.com) 1. [Pulumi](https://pulumi.com) +1. [prestd](https://prestd.com) 1. [Schwarz IT](https://jobs.schwarz) 1. [SemaphoreCI](https://semaphoreci.com) 1. [Sigstore](https://sigstore.dev) 1. [Splunk](http://dev.splunk.com) 1. [Sysdig](https://sysdig.com) 1. [TOTVS Labs](https://totvslabs.com) +1. [Trybe](https://betrybe.com) Feel free to [add yours](https://github.com/goreleaser/goreleaser/edit/main/USERS.md)! diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitea.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitea.go index 376d428e..a493b249 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitea.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitea.go @@ -61,7 +61,9 @@ func NewGitea(ctx *context.Context, token string) (Client, error) { return nil, err } if ctx != nil { - gitea.SetContext(ctx)(client) + if err := gitea.SetContext(ctx)(client); err != nil { + return nil, err + } } return &giteaClient{client: client}, nil } diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/client/github.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/client/github.go index 1fb6f428..70f4ad30 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/client/github.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/client/github.go @@ -11,7 +11,7 @@ import ( "strings" "github.com/apex/log" - "github.com/google/go-github/v39/github" + "github.com/google/go-github/v41/github" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitlab.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitlab.go index d3d518b1..1e25ef32 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitlab.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/client/gitlab.go @@ -377,33 +377,61 @@ func (c *gitlabClient) Upload( projectID = ctx.Config.Release.GitLab.Owner + "/" + projectID } - log.WithField("file", file.Name()).Debug("uploading file") - projectFile, _, err := c.client.Projects.UploadFile( - projectID, - file.Name(), - nil, - ) - if err != nil { - return err + var baseLinkURL string + var linkURL string + if ctx.Config.GitLabURLs.UsePackageRegistry { + log.WithField("file", file.Name()).Debug("uploading file as generic package") + if _, _, err := c.client.GenericPackages.PublishPackageFile( + projectID, + ctx.Config.ProjectName, + ctx.Version, + artifact.Name, + file, + nil, + ); err != nil { + return err + } + + baseLinkURL, err = c.client.GenericPackages.FormatPackageURL( + projectID, + ctx.Config.ProjectName, + ctx.Version, + artifact.Name, + ) + if err != nil { + return err + } + linkURL = c.client.BaseURL().String() + baseLinkURL + } else { + log.WithField("file", file.Name()).Debug("uploading file as attachment") + projectFile, _, err := c.client.Projects.UploadFile( + projectID, + file.Name(), + nil, + ) + if err != nil { + return err + } + + baseLinkURL = projectFile.URL + gitlabBaseURL, err := tmpl.New(ctx).Apply(ctx.Config.GitLabURLs.Download) + if err != nil { + return fmt.Errorf("templating GitLab Download URL: %w", err) + } + + // search for project details based on projectID + projectDetails, _, err := c.client.Projects.GetProject(projectID, nil) + if err != nil { + return err + } + linkURL = gitlabBaseURL + "/" + projectDetails.PathWithNamespace + baseLinkURL } log.WithFields(log.Fields{ "file": file.Name(), - "url": projectFile.URL, + "url": baseLinkURL, }).Debug("uploaded file") - // search for project details based on projectID - projectDetails, _, err := c.client.Projects.GetProject(projectID, nil) - if err != nil { - return err - } - - gitlabBaseURL, err := tmpl.New(ctx).Apply(ctx.Config.GitLabURLs.Download) - if err != nil { - return fmt.Errorf("templating GitLab Download URL: %w", err) - } - - linkURL := gitlabBaseURL + "/" + projectDetails.PathWithNamespace + projectFile.URL name := artifact.Name filename := "/" + name releaseLink, _, err := c.client.ReleaseLinks.CreateReleaseLink( diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/commitauthor/author.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/commitauthor/author.go new file mode 100644 index 00000000..b7282b27 --- /dev/null +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/commitauthor/author.go @@ -0,0 +1,37 @@ +// Package commitauthor provides common commit author functionality. +package commitauthor + +import ( + "github.com/goreleaser/goreleaser/internal/tmpl" + "github.com/goreleaser/goreleaser/pkg/config" + "github.com/goreleaser/goreleaser/pkg/context" +) + +const ( + defaultName = "goreleaserbot" + defaultEmail = "goreleaser@carlosbecker.com" +) + +// Get templates the commit author and returns the filled fields. +func Get(ctx *context.Context, og config.CommitAuthor) (config.CommitAuthor, error) { + var author config.CommitAuthor + var err error + + author.Name, err = tmpl.New(ctx).Apply(og.Name) + if err != nil { + return author, err + } + author.Email, err = tmpl.New(ctx).Apply(og.Email) + return author, err +} + +// Default sets the default commit author name and email. +func Default(og config.CommitAuthor) config.CommitAuthor { + if og.Name == "" { + og.Name = defaultName + } + if og.Email == "" { + og.Email = defaultEmail + } + return og +} diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/exec/exec.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/exec/exec.go index 335dbfeb..3f6d773b 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/exec/exec.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/exec/exec.go @@ -11,6 +11,7 @@ import ( "github.com/apex/log" "github.com/caarlos0/go-shellwords" "github.com/goreleaser/goreleaser/internal/artifact" + "github.com/goreleaser/goreleaser/internal/extrafiles" "github.com/goreleaser/goreleaser/internal/gio" "github.com/goreleaser/goreleaser/internal/logext" "github.com/goreleaser/goreleaser/internal/pipe" @@ -43,6 +44,20 @@ func Execute(ctx *context.Context, publishers []config.Publisher) error { func executePublisher(ctx *context.Context, publisher config.Publisher) error { log.Debugf("filtering %d artifacts", len(ctx.Artifacts.List())) artifacts := filterArtifacts(ctx.Artifacts, publisher) + + extraFiles, err := extrafiles.Find(ctx, publisher.ExtraFiles) + if err != nil { + return err + } + + for name, path := range extraFiles { + artifacts = append(artifacts, &artifact.Artifact{ + Name: name, + Path: path, + Type: artifact.UploadableFile, + }) + } + log.Debugf("will execute custom publisher with %d artifacts", len(artifacts)) g := semerrgroup.New(ctx.Parallelism) diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/announce/announce.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/announce/announce.go index cb564482..4b98bb64 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/announce/announce.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/announce/announce.go @@ -17,6 +17,7 @@ import ( "github.com/goreleaser/goreleaser/internal/pipe/teams" "github.com/goreleaser/goreleaser/internal/pipe/telegram" "github.com/goreleaser/goreleaser/internal/pipe/twitter" + "github.com/goreleaser/goreleaser/internal/pipe/webhook" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" ) @@ -39,6 +40,7 @@ var announcers = []Announcer{ teams.Pipe{}, telegram.Pipe{}, twitter.Pipe{}, + webhook.Pipe{}, } // Pipe that announces releases. diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/brew/brew.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/brew/brew.go index 4c5e4f3c..519b4ead 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/brew/brew.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/brew/brew.go @@ -15,6 +15,7 @@ import ( "github.com/apex/log" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/client" + "github.com/goreleaser/goreleaser/internal/commitauthor" "github.com/goreleaser/goreleaser/internal/pipe" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" @@ -42,12 +43,8 @@ func (Pipe) Default(ctx *context.Context) error { for i := range ctx.Config.Brews { brew := &ctx.Config.Brews[i] - if brew.CommitAuthor.Name == "" { - brew.CommitAuthor.Name = "goreleaserbot" - } - if brew.CommitAuthor.Email == "" { - brew.CommitAuthor.Email = "goreleaser@carlosbecker.com" - } + brew.CommitAuthor = commitauthor.Default(brew.CommitAuthor) + if brew.CommitMessageTemplate == "" { brew.CommitMessageTemplate = "Brew formula update for {{ .ProjectName }} version {{ .Tag }}" } @@ -135,12 +132,17 @@ func doPublish(ctx *context.Context, formula *artifact.Artifact, cl client.Clien return err } + author, err := commitauthor.Get(ctx, brew.CommitAuthor) + if err != nil { + return err + } + content, err := os.ReadFile(formula.Path) if err != nil { return err } - return cl.CreateFile(ctx, brew.CommitAuthor, repo, content, gpath, msg) + return cl.CreateFile(ctx, author, repo, content, gpath, msg) } func doRun(ctx *context.Context, brew config.Homebrew, cl client.Client) error { diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/changelog/changelog.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/changelog/changelog.go index f7d37d16..15cb2c30 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/changelog/changelog.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/changelog/changelog.go @@ -14,7 +14,6 @@ import ( "github.com/goreleaser/goreleaser/internal/client" "github.com/goreleaser/goreleaser/internal/git" "github.com/goreleaser/goreleaser/internal/tmpl" - "github.com/goreleaser/goreleaser/pkg/config" "github.com/goreleaser/goreleaser/pkg/context" ) @@ -23,6 +22,19 @@ var ErrInvalidSortDirection = errors.New("invalid sort direction") const li = "* " +type useChangelog string + +func (u useChangelog) formatable() bool { + return u != "github-native" +} + +const ( + useGit = "git" + useGitHub = "github" + useGitLab = "gitlab" + useGitHubNative = "github-native" +) + // Pipe for checksums. type Pipe struct{} @@ -60,53 +72,11 @@ func (Pipe) Run(ctx *context.Context) error { return err } - changelogStringJoiner := "\n" - if ctx.TokenType == context.TokenTypeGitLab || ctx.TokenType == context.TokenTypeGitea { - // We need two or more whitespace to let markdown interpret - // it as newline. See https://docs.gitlab.com/ee/user/markdown.html#newlines for details - log.Debug("is gitlab or gitea changelog") - changelogStringJoiner = " \n" - } - - changelogElements := []string{ - "## Changelog", - } - - if shouldGroup(ctx.Config.Changelog) { - log.Debug("grouping entries") - groups := ctx.Config.Changelog.Groups - - sort.Slice(groups, func(i, j int) bool { return groups[i].Order < groups[j].Order }) - for _, group := range groups { - items := make([]string, 0) - if group.Regexp == "" { - // If no regexp is provided, we purge all strikethrough entries and add remaining entries to the list - items = getAllNonEmpty(entries) - // clear array - entries = nil - } else { - regex, err := regexp.Compile(group.Regexp) - if err != nil { - return fmt.Errorf("failed to group into %q: %w", group.Title, err) - } - for i, entry := range entries { - match := regex.MatchString(entry) - if match { - items = append(items, li+entry) - // Striking out the matched entry - entries[i] = "" - } - } - } - if len(items) > 0 { - changelogElements = append(changelogElements, fmt.Sprintf("### %s", group.Title)) - changelogElements = append(changelogElements, strings.Join(items, changelogStringJoiner)) - } - } - } else { - log.Debug("not grouping entries") - changelogElements = append(changelogElements, strings.Join(getAllNonEmpty(entries), changelogStringJoiner)) + changes, err := formatChangelog(ctx, entries) + if err != nil { + return err } + changelogElements := []string{changes} if header != "" { changelogElements = append([]string{header}, changelogElements...) @@ -125,11 +95,60 @@ func (Pipe) Run(ctx *context.Context) error { return os.WriteFile(path, []byte(ctx.ReleaseNotes), 0o644) //nolint: gosec } -func shouldGroup(cfg config.Changelog) bool { - return len(cfg.Groups) > 0 && cfg.Use != "github-native" +func formatChangelog(ctx *context.Context, entries []string) (string, error) { + newLine := "\n" + if ctx.TokenType == context.TokenTypeGitLab || ctx.TokenType == context.TokenTypeGitea { + // We need two or more whitespace to let markdown interpret + // it as newline. See https://docs.gitlab.com/ee/user/markdown.html#newlines for details + log.Debug("is gitlab or gitea changelog") + newLine = " \n" + } + + if !useChangelog(ctx.Config.Changelog.Use).formatable() { + return strings.Join(entries, newLine), nil + } + + result := []string{"## Changelog"} + if len(ctx.Config.Changelog.Groups) == 0 { + log.Debug("not grouping entries") + return strings.Join(append(result, filterAndPrefixItems(entries)...), newLine), nil + } + + log.Debug("grouping entries") + groups := ctx.Config.Changelog.Groups + + sort.Slice(groups, func(i, j int) bool { return groups[i].Order < groups[j].Order }) + for _, group := range groups { + items := make([]string, 0) + if group.Regexp == "" { + // If no regexp is provided, we purge all strikethrough entries and add remaining entries to the list + items = filterAndPrefixItems(entries) + // clear array + entries = nil + } else { + regex, err := regexp.Compile(group.Regexp) + if err != nil { + return "", fmt.Errorf("failed to group into %q: %w", group.Title, err) + } + for i, entry := range entries { + match := regex.MatchString(entry) + if match { + items = append(items, li+entry) + // Striking out the matched entry + entries[i] = "" + } + } + } + if len(items) > 0 { + result = append(result, fmt.Sprintf("### %s", group.Title)) + result = append(result, items...) + } + } + + return strings.Join(result, newLine), nil } -func getAllNonEmpty(ss []string) []string { +func filterAndPrefixItems(ss []string) []string { var r []string for _, s := range ss { if s != "" { @@ -169,6 +188,9 @@ func buildChangelog(ctx *context.Context) ([]string, error) { if lastLine := entries[len(entries)-1]; strings.TrimSpace(lastLine) == "" { entries = entries[0 : len(entries)-1] } + if !useChangelog(ctx.Config.Changelog.Use).formatable() { + return entries, nil + } entries, err = filterEntries(ctx, entries) if err != nil { return entries, err @@ -241,15 +263,15 @@ func doGetChangelog(ctx *context.Context, prev, tag string) (string, error) { func getChangeloger(ctx *context.Context) (changeloger, error) { switch ctx.Config.Changelog.Use { - case "git": + case useGit: fallthrough case "": return gitChangeloger{}, nil - case "github": + case useGitHub: fallthrough - case "gitlab": + case useGitLab: return newSCMChangeloger(ctx) - case "github-native": + case useGitHubNative: return newGithubChangeloger(ctx) default: return nil, fmt.Errorf("invalid changelog.use: %q", ctx.Config.Changelog.Use) diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/defaults/defaults.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/defaults/defaults.go index d23ce7ba..4bdfeb1c 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/defaults/defaults.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/defaults/defaults.go @@ -8,7 +8,6 @@ import ( "github.com/goreleaser/goreleaser/internal/client" "github.com/goreleaser/goreleaser/internal/middleware/errhandler" - "github.com/goreleaser/goreleaser/internal/middleware/logging" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" "github.com/goreleaser/goreleaser/pkg/defaults" @@ -39,11 +38,7 @@ func (Pipe) Run(ctx *context.Context) error { ctx.Config.GiteaURLs.Download = strings.ReplaceAll(apiURL, "/api/v1", "") } for _, defaulter := range defaults.Defaulters { - if err := logging.Log( - defaulter.String(), - errhandler.Handle(defaulter.Default), - logging.ExtraPadding, - )(ctx); err != nil { + if err := errhandler.Handle(defaulter.Default)(ctx); err != nil { return err } } diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/docker/docker.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/docker/docker.go index c825e0d5..9df772ce 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/docker/docker.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/docker/docker.go @@ -143,7 +143,11 @@ func process(ctx *context.Context, docker config.Docker, artifacts []*artifact.A log.Debug("tempdir: " + tmp) if docker.Use != useBuildPacks { - if err := gio.Copy(docker.Dockerfile, filepath.Join(tmp, "Dockerfile")); err != nil { + dockerfile, err := tmpl.New(ctx).Apply(docker.Dockerfile) + if err != nil { + return err + } + if err := gio.Copy(dockerfile, filepath.Join(tmp, "Dockerfile")); err != nil { return fmt.Errorf("failed to copy dockerfile: %w", err) } } diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/gofish/gofish.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/gofish/gofish.go index aaf0dea9..3763ab16 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/gofish/gofish.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/gofish/gofish.go @@ -14,6 +14,7 @@ import ( "github.com/apex/log" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/client" + "github.com/goreleaser/goreleaser/internal/commitauthor" "github.com/goreleaser/goreleaser/internal/pipe" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" @@ -37,12 +38,7 @@ func (Pipe) Default(ctx *context.Context) error { for i := range ctx.Config.Rigs { goFish := &ctx.Config.Rigs[i] - if goFish.CommitAuthor.Name == "" { - goFish.CommitAuthor.Name = "goreleaserbot" - } - if goFish.CommitAuthor.Email == "" { - goFish.CommitAuthor.Email = "goreleaser@carlosbecker.com" - } + goFish.CommitAuthor = commitauthor.Default(goFish.CommitAuthor) if goFish.CommitMessageTemplate == "" { goFish.CommitMessageTemplate = "GoFish fish food update for {{ .ProjectName }} version {{ .Tag }}" } @@ -297,12 +293,17 @@ func doPublish(ctx *context.Context, food *artifact.Artifact, cl client.Client) return err } + author, err := commitauthor.Get(ctx, rig.CommitAuthor) + if err != nil { + return err + } + content, err := os.ReadFile(food.Path) if err != nil { return err } - return cl.CreateFile(ctx, rig.CommitAuthor, repo, content, gpath, msg) + return cl.CreateFile(ctx, author, repo, content, gpath, msg) } func buildFoodPath(folder, filename string) string { diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/krew/krew.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/krew/krew.go index e0f3c649..fecbbd41 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/krew/krew.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/krew/krew.go @@ -16,6 +16,7 @@ import ( "github.com/apex/log" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/client" + "github.com/goreleaser/goreleaser/internal/commitauthor" "github.com/goreleaser/goreleaser/internal/pipe" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" @@ -42,12 +43,7 @@ func (Pipe) Default(ctx *context.Context) error { for i := range ctx.Config.Krews { krew := &ctx.Config.Krews[i] - if krew.CommitAuthor.Name == "" { - krew.CommitAuthor.Name = "goreleaserbot" - } - if krew.CommitAuthor.Email == "" { - krew.CommitAuthor.Email = "goreleaser@carlosbecker.com" - } + krew.CommitAuthor = commitauthor.Default(krew.CommitAuthor) if krew.CommitMessageTemplate == "" { krew.CommitMessageTemplate = "Krew manifest update for {{ .ProjectName }} version {{ .Tag }}" } @@ -308,12 +304,17 @@ func doPublish(ctx *context.Context, manifest *artifact.Artifact, cl client.Clie return err } + author, err := commitauthor.Get(ctx, cfg.CommitAuthor) + if err != nil { + return err + } + content, err := os.ReadFile(manifest.Path) if err != nil { return err } - return cl.CreateFile(ctx, cfg.CommitAuthor, repo, content, gpath, msg) + return cl.CreateFile(ctx, author, repo, content, gpath, msg) } func buildManifestPath(folder, filename string) string { diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/reddit/reddit.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/reddit/reddit.go index 55623210..0267d192 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/reddit/reddit.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/reddit/reddit.go @@ -5,9 +5,9 @@ import ( "github.com/apex/log" "github.com/caarlos0/env/v6" + "github.com/caarlos0/go-reddit/v3/reddit" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/context" - "github.com/vartanbeno/go-reddit/v2/reddit" ) const ( diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/scoop/scoop.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/scoop/scoop.go index c876a92e..b5422f87 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/scoop/scoop.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/scoop/scoop.go @@ -14,6 +14,7 @@ import ( "github.com/apex/log" "github.com/goreleaser/goreleaser/internal/artifact" "github.com/goreleaser/goreleaser/internal/client" + "github.com/goreleaser/goreleaser/internal/commitauthor" "github.com/goreleaser/goreleaser/internal/pipe" "github.com/goreleaser/goreleaser/internal/tmpl" "github.com/goreleaser/goreleaser/pkg/config" @@ -54,12 +55,7 @@ func (Pipe) Default(ctx *context.Context) error { if ctx.Config.Scoop.Name == "" { ctx.Config.Scoop.Name = ctx.Config.ProjectName } - if ctx.Config.Scoop.CommitAuthor.Name == "" { - ctx.Config.Scoop.CommitAuthor.Name = "goreleaserbot" - } - if ctx.Config.Scoop.CommitAuthor.Email == "" { - ctx.Config.Scoop.CommitAuthor.Email = "goreleaser@carlosbecker.com" - } + ctx.Config.Scoop.CommitAuthor = commitauthor.Default(ctx.Config.Scoop.CommitAuthor) if ctx.Config.Scoop.CommitMessageTemplate == "" { ctx.Config.Scoop.CommitMessageTemplate = "Scoop update for {{ .ProjectName }} version {{ .Tag }}" } @@ -145,6 +141,11 @@ func doPublish(ctx *context.Context, cl client.Client) error { return err } + author, err := commitauthor.Get(ctx, scoop.CommitAuthor) + if err != nil { + return err + } + content, err := os.ReadFile(manifest.Path) if err != nil { return err @@ -153,7 +154,7 @@ func doPublish(ctx *context.Context, cl client.Client) error { repo := client.RepoFromRef(scoop.Bucket) return cl.CreateFile( ctx, - scoop.CommitAuthor, + author, repo, content, path.Join(scoop.Folder, manifest.Name), diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/universalbinary/universalbinary.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/universalbinary/universalbinary.go index b7638f05..1654270b 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/universalbinary/universalbinary.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/universalbinary/universalbinary.go @@ -34,6 +34,9 @@ func (Pipe) Default(ctx *context.Context) error { if unibin.ID == "" { unibin.ID = ctx.Config.ProjectName } + if len(unibin.IDs) == 0 { + unibin.IDs = []string{unibin.ID} + } if unibin.NameTemplate == "" { unibin.NameTemplate = "{{ .ProjectName }}" } @@ -228,6 +231,6 @@ func filterFor(unibin config.UniversalBinary) artifact.Filter { return artifact.And( artifact.ByType(artifact.Binary), artifact.ByGoos("darwin"), - artifact.ByIDs(unibin.ID), + artifact.ByIDs(unibin.IDs...), ) } diff --git a/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/webhook/webhook.go b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/webhook/webhook.go new file mode 100644 index 00000000..75047e23 --- /dev/null +++ b/tools/vendor/github.com/goreleaser/goreleaser/internal/pipe/webhook/webhook.go @@ -0,0 +1,119 @@ +package webhook + +import ( + "crypto/tls" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/apex/log" + "github.com/caarlos0/env/v6" + "github.com/goreleaser/goreleaser/internal/tmpl" + "github.com/goreleaser/goreleaser/pkg/context" +) + +const ( + defaultMessageTemplate = `{ "message": "{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}"}` + ContentTypeHeaderKey = "Content-Type" + UserAgentHeaderKey = "User-Agent" + UserAgentHeaderValue = "gorleaser" + AuthorizationHeaderKey = "Authorization" + DefaultContentType = "application/json; charset=utf-8" +) + +type Pipe struct{} + +func (Pipe) String() string { return "webhook" } +func (Pipe) Skip(ctx *context.Context) bool { return !ctx.Config.Announce.Webhook.Enabled } + +type Config struct { + BasicAuthHeader string `env:"BASIC_AUTH_HEADER_VALUE"` + BearerTokenHeader string `env:"BEARER_TOKEN_HEADER_VALUE"` +} + +func (p Pipe) Default(ctx *context.Context) error { + if ctx.Config.Announce.Webhook.MessageTemplate == "" { + ctx.Config.Announce.Webhook.MessageTemplate = defaultMessageTemplate + } + if ctx.Config.Announce.Webhook.ContentType == "" { + ctx.Config.Announce.Webhook.ContentType = DefaultContentType + } + return nil +} + +func (p Pipe) Announce(ctx *context.Context) error { + var cfg Config + if err := env.Parse(&cfg); err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %w", err) + } + + endpointURLConfig, err := tmpl.New(ctx).Apply(ctx.Config.Announce.Webhook.EndpointURL) + if err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %w", err) + } + if len(endpointURLConfig) == 0 { + return errors.New("announce: failed to announce to webhook: no endpoint url") + } + + if _, err := url.ParseRequestURI(endpointURLConfig); err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %w", err) + } + endpointURL, err := url.Parse(endpointURLConfig) + if err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %w", err) + } + + msg, err := tmpl.New(ctx).Apply(ctx.Config.Announce.Webhook.MessageTemplate) + if err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %s", err) + } + + log.Infof("posting: '%s'", msg) + customTransport := http.DefaultTransport.(*http.Transport).Clone() + + customTransport.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: ctx.Config.Announce.Webhook.SkipTLSVerify, + } + + client := &http.Client{ + Transport: customTransport, + } + + req, err := http.NewRequest(http.MethodPost, endpointURL.String(), strings.NewReader(msg)) + if err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %w", err) + } + req.Header.Add(ContentTypeHeaderKey, ctx.Config.Announce.Webhook.ContentType) + req.Header.Add(UserAgentHeaderKey, UserAgentHeaderValue) + + if cfg.BasicAuthHeader != "" { + log.Debugf("set basic auth header") + req.Header.Add(AuthorizationHeaderKey, cfg.BasicAuthHeader) + } else if cfg.BearerTokenHeader != "" { + log.Debugf("set bearer token header") + req.Header.Add(AuthorizationHeaderKey, cfg.BearerTokenHeader) + } + + for key, value := range ctx.Config.Announce.Webhook.Headers { + log.Debugf("Header Key %s / Value %s", key, value) + req.Header.Add(key, value) + } + resp, err := client.Do(req) + if err != nil { + return fmt.Errorf("announce: failed to announce to webhook: %w", err) + } + defer resp.Body.Close() + + switch resp.StatusCode { + case http.StatusOK, http.StatusCreated, http.StatusAccepted, http.StatusNoContent: + log.Infof("Post OK: '%v'", resp.StatusCode) + body, _ := io.ReadAll(resp.Body) + log.Infof("Response : %v\n", string(body)) + return nil + default: + return fmt.Errorf("request failed with status %v", resp.Status) + } +} diff --git a/tools/vendor/github.com/goreleaser/goreleaser/pkg/config/config.go b/tools/vendor/github.com/goreleaser/goreleaser/pkg/config/config.go index 7b19ff63..e59a5380 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/pkg/config/config.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/pkg/config/config.go @@ -25,9 +25,10 @@ type GitHubURLs struct { // GitLabURLs holds the URLs to be used when using gitlab ce/enterprise. type GitLabURLs struct { - API string `yaml:"api,omitempty"` - Download string `yaml:"download,omitempty"` - SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"` + API string `yaml:"api,omitempty"` + Download string `yaml:"download,omitempty"` + SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"` + UsePackageRegistry bool `yaml:"use_package_registry,omitempty"` } // GiteaURLs holds the URLs to be used when using gitea. @@ -434,7 +435,8 @@ func (f File) JSONSchemaType() *jsonschema.Type { // UniversalBinary setups macos universal binaries. type UniversalBinary struct { - ID string `yaml:"id,omitempty"` + ID string `yaml:"id,omitempty"` // deprecated + IDs []string `yaml:"ids,omitempty"` NameTemplate string `yaml:"name_template,omitempty"` Replace bool `yaml:"replace,omitempty"` Hooks BuildHookConfig `yaml:"hooks,omitempty"` @@ -799,13 +801,14 @@ type Upload struct { // Publisher configuration. type Publisher struct { - Name string `yaml:"name,omitempty"` - IDs []string `yaml:"ids,omitempty"` - Checksum bool `yaml:"checksum,omitempty"` - Signature bool `yaml:"signature,omitempty"` - Dir string `yaml:"dir,omitempty"` - Cmd string `yaml:"cmd,omitempty"` - Env []string `yaml:"env,omitempty"` + Name string `yaml:"name,omitempty"` + IDs []string `yaml:"ids,omitempty"` + Checksum bool `yaml:"checksum,omitempty"` + Signature bool `yaml:"signature,omitempty"` + Dir string `yaml:"dir,omitempty"` + Cmd string `yaml:"cmd,omitempty"` + Env []string `yaml:"env,omitempty"` + ExtraFiles []ExtraFile `yaml:"extra_files,omitempty"` } // Source configuration. @@ -881,6 +884,16 @@ type Announce struct { Mattermost Mattermost `yaml:"mattermost,omitempty"` LinkedIn LinkedIn `yaml:"linkedin,omitempty"` Telegram Telegram `yaml:"telegram,omitempty"` + Webhook Webhook `yaml:"webhook,omitempty"` +} + +type Webhook struct { + Enabled bool `yaml:"enabled,omitempty"` + SkipTLSVerify bool `yaml:"skip_tls_verify,omitempty"` + MessageTemplate string `yaml:"message_template,omitempty"` + EndpointURL string `yaml:"endpoint_url,omitempty"` + Headers map[string]string `yaml:"headers,omitempty"` + ContentType string `yaml:"content_type,omitempty"` } type Twitter struct { diff --git a/tools/vendor/github.com/goreleaser/goreleaser/pkg/defaults/defaults.go b/tools/vendor/github.com/goreleaser/goreleaser/pkg/defaults/defaults.go index a5f751f7..3e1b9714 100644 --- a/tools/vendor/github.com/goreleaser/goreleaser/pkg/defaults/defaults.go +++ b/tools/vendor/github.com/goreleaser/goreleaser/pkg/defaults/defaults.go @@ -35,6 +35,7 @@ import ( "github.com/goreleaser/goreleaser/internal/pipe/telegram" "github.com/goreleaser/goreleaser/internal/pipe/twitter" "github.com/goreleaser/goreleaser/internal/pipe/universalbinary" + "github.com/goreleaser/goreleaser/internal/pipe/webhook" "github.com/goreleaser/goreleaser/pkg/context" ) @@ -82,4 +83,5 @@ var Defaulters = []Defaulter{ milestone.Pipe{}, linkedin.Pipe{}, telegram.Pipe{}, + webhook.Pipe{}, } diff --git a/tools/vendor/github.com/slack-go/slack/README.md b/tools/vendor/github.com/slack-go/slack/README.md index dbf73d4e..ee3eedcd 100644 --- a/tools/vendor/github.com/slack-go/slack/README.md +++ b/tools/vendor/github.com/slack-go/slack/README.md @@ -1,9 +1,9 @@ Slack API in Go [![Go Reference](https://pkg.go.dev/badge/github.com/slack-go/slack.svg)](https://pkg.go.dev/github.com/slack-go/slack) =============== -This is the original Slack library for Go created by Norberto Lopes, transferred to a Github organization. +This is the original Slack library for Go created by Norberto Lopes, transferred to a GitHub organization. -[![Join the chat at https://gitter.im/go-slack/Lobby](https://badges.gitter.im/go-slack/Lobby.svg)](https://gitter.im/go-slack/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +You can also chat with us on the #slack-go, #slack-go-ja Slack channel on the Gophers Slack. ![logo](logo.png "icon") diff --git a/tools/vendor/modules.txt b/tools/vendor/modules.txt index 8d5a0858..8b426436 100644 --- a/tools/vendor/modules.txt +++ b/tools/vendor/modules.txt @@ -18,7 +18,7 @@ cloud.google.com/go/kms/apiv1 ## explicit; go 1.11 cloud.google.com/go/storage cloud.google.com/go/storage/internal/apiv2 -# code.gitea.io/sdk/gitea v0.15.0 +# code.gitea.io/sdk/gitea v0.15.1 ## explicit; go 1.13 code.gitea.io/sdk/gitea # github.com/AlekSi/pointer v1.2.0 @@ -312,9 +312,12 @@ github.com/butuzov/ireturn/types # github.com/caarlos0/ctrlc v1.0.0 ## explicit github.com/caarlos0/ctrlc -# github.com/caarlos0/env/v6 v6.8.0 +# github.com/caarlos0/env/v6 v6.9.1 ## explicit; go 1.17 github.com/caarlos0/env/v6 +# github.com/caarlos0/go-reddit/v3 v3.0.1 +## explicit; go 1.17 +github.com/caarlos0/go-reddit/v3/reddit # github.com/caarlos0/go-shellwords v1.0.12 ## explicit; go 1.13 github.com/caarlos0/go-shellwords @@ -364,8 +367,8 @@ github.com/denis-tingajkin/go-header # github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb ## explicit; go 1.16 github.com/dghubble/go-twitter/twitter -# github.com/dghubble/oauth1 v0.7.0 -## explicit; go 1.12 +# github.com/dghubble/oauth1 v0.7.1 +## explicit; go 1.16 github.com/dghubble/oauth1 # github.com/dghubble/sling v1.4.0 ## explicit; go 1.16 @@ -642,9 +645,9 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/go-github/v39 v39.2.0 +# github.com/google/go-github/v41 v41.0.0 ## explicit; go 1.16 -github.com/google/go-github/v39/github +github.com/google/go-github/v41/github # github.com/google/go-querystring v1.1.0 ## explicit; go 1.10 github.com/google/go-querystring/query @@ -674,7 +677,7 @@ github.com/goreleaser/chglog # github.com/goreleaser/fileglob v1.2.0 ## explicit; go 1.16 github.com/goreleaser/fileglob -# github.com/goreleaser/goreleaser v1.2.5 +# github.com/goreleaser/goreleaser v1.3.0 ## explicit; go 1.17 github.com/goreleaser/goreleaser github.com/goreleaser/goreleaser/cmd @@ -682,6 +685,7 @@ github.com/goreleaser/goreleaser/internal/artifact github.com/goreleaser/goreleaser/internal/builders/buildtarget github.com/goreleaser/goreleaser/internal/builders/golang github.com/goreleaser/goreleaser/internal/client +github.com/goreleaser/goreleaser/internal/commitauthor github.com/goreleaser/goreleaser/internal/deprecate github.com/goreleaser/goreleaser/internal/exec github.com/goreleaser/goreleaser/internal/extrafiles @@ -738,6 +742,7 @@ github.com/goreleaser/goreleaser/internal/pipe/telegram github.com/goreleaser/goreleaser/internal/pipe/twitter github.com/goreleaser/goreleaser/internal/pipe/universalbinary github.com/goreleaser/goreleaser/internal/pipe/upload +github.com/goreleaser/goreleaser/internal/pipe/webhook github.com/goreleaser/goreleaser/internal/pipeline github.com/goreleaser/goreleaser/internal/semerrgroup github.com/goreleaser/goreleaser/internal/shell @@ -1043,7 +1048,7 @@ github.com/sirupsen/logrus # github.com/sivchari/tenv v1.4.7 ## explicit; go 1.17 github.com/sivchari/tenv -# github.com/slack-go/slack v0.10.0 +# github.com/slack-go/slack v0.10.1 ## explicit; go 1.16 github.com/slack-go/slack github.com/slack-go/slack/internal/backoff @@ -1135,9 +1140,6 @@ github.com/ultraware/whitespace # github.com/uudashr/gocognit v1.0.5 ## explicit; go 1.16 github.com/uudashr/gocognit -# github.com/vartanbeno/go-reddit/v2 v2.0.1 -## explicit; go 1.15 -github.com/vartanbeno/go-reddit/v2/reddit # github.com/xanzy/go-gitlab v0.52.2 ## explicit; go 1.13 github.com/xanzy/go-gitlab